Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add leading zeros to number javascript

const number = 5;
console.log(number.toString().padStart(2, '0')); // expected output: "05"
 
PREVIOUS NEXT
Tagged: #add #leading #zeros #number #javascript
ADD COMMENT
Topic
Name
8+9 =