Skip to content

Instantly share code, notes, and snippets.

@vkobel
Created January 7, 2014 09:26
Show Gist options
  • Save vkobel/8296898 to your computer and use it in GitHub Desktop.
Save vkobel/8296898 to your computer and use it in GitHub Desktop.
Simple left padding function in javascript
function leftpad(padding, val){
return (padding + val).slice(padding.length * -1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment