3 ms·
Did 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
by hn_throwaway_99 6y ago
Did 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.