Answers for "javascript regex add leading zeros"

2

add leading zeros to number javascript

const number = 5;
console.log(number.toString().padStart(2, '0')); // expected output: "05"
Posted by: Guest on August-12-2021
1

add leading zeros javascript

const str1 = '5';
console.log(str1.padStart(2, '0')); // expected output: "05"
Posted by: Guest on August-12-2021

Code answers related to "javascript regex add leading zeros"

Code answers related to "Javascript"

Browse Popular Code Answers by Language