January 2020
Intermediate to advanced
470 pages
11h 13m
English
Methods such as filter() and map() are only available for arrays; however, you may want to apply them to, say, a NodeList or a String, and you'd be out of luck. Also, we are focusing on strings, so having to use these functions as methods is not exactly what we had in mind. Finally, whenever we create a new function (such as none(), which we saw in the Checking negatives section of Chapter 5, Programming Declaratively – A Better Style), it cannot be applied in the same way as its peers (some() and every(), in this case) unless you do some prototype trickery. This is rightly frowned upon and not recommended.
Read now
Unlock full access