Skip to content

Instantly share code, notes, and snippets.

@bultas
Created July 18, 2014 16:45
Show Gist options
  • Save bultas/524a6199a7a053420428 to your computer and use it in GitHub Desktop.
Save bultas/524a6199a7a053420428 to your computer and use it in GitHub Desktop.
Two digits (great for date formating to MM or DD
function twoDigits(n) {
return n < 10 ? '0' + n : '' + n;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment