Created
January 7, 2014 09:26
-
-
Save vkobel/8296898 to your computer and use it in GitHub Desktop.
Simple left padding function in javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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