Snippets Collections
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;
   }
   return str;
}
star

Fri Dec 27 2019 19:07:08 GMT+0000 (Coordinated Universal Time) https://qz.com/646467/how-one-programmer-broke-the-internet-by-deleting-a-tiny-piece-of-code/

#javascript #interesting #historicalcode #leftpad

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension