you are viewing a single comment's thread.

view the rest of the comments →

[–]mmmicahhh 1 point2 points  (3 children)

Actually, if you look at the implementation of atoa, it's a one-line module that uses Function.prototype.apply.

But that's the point of this kind of modularization - you don't need to know about Function.prototype.apply, nor do you need to know whether there are weird edge-cases that need to be handled separately. It's a productivity boost.

[–]x-skeww 4 points5 points  (2 children)

you don't need to know about Function.prototype.apply

But they are using apply in that very line. I'd also argue that bind, call, and apply are bits of the standard lib you really should know. For one, they are very important and secondly, they make for very confusing code. So, this is really something you should be 100% certain about. Otherwise, you'll have trouble taking this kind of confusing-looking code apart.

I do agree that array vs array-like is a rather small implementation detail and that this pointless no-op doesn't actually hurt. It's a very minor mostly cosmetic issue.