Looking for a creative way to be sure values that come from the getHours, getMinutes, and getSeconds() method for the javascript Date object return \"06\" inste
\"06\"
function pad2(number) { return (number < 10 ? '0' : '') + number } document.write(pad2(2) + ''); document.write(pad2(10) + '');
OUTPUT:
02
10