Created
December 12, 2016 11:39
-
-
Save wynnzen/686111623a5921fe25a39118345d393f to your computer and use it in GitHub Desktop.
add zero before str
This file contains 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 addZero(str,length){ | |
return new Array(length - str.length + 1).join("0") + str; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment