4 ms·
It seems less trivial than PadLeft. https://arstechnica.com/information-technology/2016/03/rage-quit-coder-unpublished-17-lines-of-javascript-and-broke-the-int
by brudgers 7y ago
It seems less trivial than PadLeft.
https://arstechnica.com/information-technology/2016/03/rage-quit-coder-unpublished-17-lines-of-javascript-and-broke-the-internet/ https://arstechnica.com/information-technology/2016/03/rage-...
- crtlaltdel 7y agoas a joke i got a shirt with left-pad's source printed on it. #neverforget
- quickthrower2 7y agoI was playing with String.prototype.padLeft earlier and boy that has weird semantics. For the padding length, strings are parsed. NaN is 0, Infinity throws an error, negative Infinity is 0, true is 1. Good ol’ JS!