4 ms·
Yeah that person really dialed things up to 11 there. But I think it's a tone that stems from a legitimacy thing with javascript having a super low barrier to e
by gonzo41 6y ago
Yeah that person really dialed things up to 11 there. But I think it's a tone that stems from a legitimacy thing with javascript having a super low barrier to entry.
- hn_throwaway_99 6y agoDid you actually read the function in this library. While yes it's a single line I'm convinced that anyone who thinks this is an "obvious" implementation hasn't actually read the code.
- gonzo41 6y agoActually I did read the function, and I thought about the cycles that toString.call(arr) == '[object Array]' costs.
- hn_throwaway_99 6y agoIs there some other implementation you think would work?
- seattle_spring 6y ago... which only gets called if the native implementation of `isArray` is not found.
- karmakaze 6y agoES5 is a low requirement. I'd rather use a lib that did a better job than one that returns true for the string '[object Array]' or have the app decide for itself what its own types are.