Skip to content

Instantly share code, notes, and snippets.

@frncs-eu
Created April 18, 2019 14:06
Show Gist options
  • Save frncs-eu/2d8f5b0404744359bccfa9cb823ef006 to your computer and use it in GitHub Desktop.
Save frncs-eu/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