JavaScript में अग्रणी 0 को संरक्षित करने का कोई तरीका नहीं है। हालांकि, आप इस आईडी को एक स्ट्रिंग मान सकते हैं और आर्गुमेंट के रूप में पास कर सकते हैं।
उदाहरण
इसे स्ट्रिंग बनाकर अग्रणी 0 को संरक्षित करने के लिए निम्न कोड चलाकर देखें -
<html> <head> <script> function sayHello(name, age, id) { document.write (name + " is " + age + " years old, with id = "+id); } </script> </head> <body> <p>Click the following button to call the function</p> <form> <input type="button" onclick="sayHello('John', 26, '0678')" value="Display Employee Info"> </form> </body> </html>