Skip to content

Instantly share code, notes, and snippets.

@kde3kko
Created April 18, 2019 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kde3kko/2d8f5b0404744359bccfa9cb823ef006 to your computer and use it in GitHub Desktop.
Save kde3kko/2d8f5b0404744359bccfa9cb823ef006 to your computer and use it in GitHub Desktop.
Simple leftpad implementation
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