জাভাস্ক্রিপ্টে লিডিং ০ সংরক্ষণ করার কোনো উপায় নেই। তবে আপনি এই আইডিকে একটি স্ট্রিং হিসেবে বিবেচনা করে আর্গুমেন্ট হিসেবে পাস করতে পারেন।
উদাহরণ
স্ট্রিং বানিয়ে লিডিং ০ সংরক্ষণ করতে নিচের কোডটি চেষ্টা করুন:
<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>