Skip to content

Instantly share code, notes, and snippets.

@TianyiLi
Last active March 9, 2018 02:50
Show Gist options
  • Save TianyiLi/296084733c483dd54811ff50c84d269b to your computer and use it in GitHub Desktop.
Save TianyiLi/296084733c483dd54811ff50c84d269b to your computer and use it in GitHub Desktop.
sample lib
module.exports.repeatWord = (length) => _char => Array.from({ length }, e => _char).join('')
module.exports.range = (length, start = 0) => Array.from({ length }, (_, i) => i + start)
module.exports.zeroAdd = (length, str) => (repeatWord(length)('0') + str).slice(length * -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment