Answers for "js pad 2"

0

js pad 2

function pad2(n) {
  return (n < 10 ? '0' : '') + n; 
}
alert(pad2(3)); //03
alert(pad2(12)); //12
Posted by: Guest on March-02-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language