The instance of Array
(under the hood: the Array.prototype
) provides a bunch of methods for handling its content in functional way. Almost any array method can be substituted with another one.
Why? ― because JavaScript is so JavaScript.
Despite of we can, it doesn’t mean we have to. So let’s take a deeper look at array methods and decide what’s the proper use case for each of them.