Created
April 18, 2019 14:06
-
-
Save frncs-eu/2d8f5b0404744359bccfa9cb823ef006 to your computer and use it in GitHub Desktop.
Simple leftpad implementation
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
const leftpad = (str,len,ch) => [...Array(len - str.length)].map(c => ch).join("")+str; | |
module.exports = leftpad; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment