Add leading zeros to a number if applicable
pad = (num) -> ('0'+num).slice(-2) console.log pad(8) console.log pad(12)