two digit number javascript code example
Example 1: javascript two character integer
var myNumber = 7;
var formattedNumber = ("0" + myNumber).slice(-2);
console.log(formattedNumber);
Example 2: two digit js''
var myNumber = 8;
var formattedNumber = ("0" + myNumber).slice(-2);
console.log(formattedNumber);