4 ms·
as a joke i got a shirt with left-pad's source printed on it. #neverforget
by crtlaltdel 7y ago
as 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!