Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add leading zeros javascript

const str1 = '5';
console.log(str1.padStart(2, '0')); // expected output: "05"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #leading #zeros #javascript
ADD COMMENT
Topic
Name
6+8 =