Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add leading zeros javascript

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