2 ms·
I 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 e
by quickthrower2 7y ago
I 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!