Andy Jarrett // Code. Develop. Create.

Exploring JS array methods, including push, pop, shift, unshift, map, filter, reduce, and others

Man running towards mountains

Classification:

Arrays are a fundamental most languages including JavaScript. Allowing us developers to store and manipulate collections of data with ease. Mastering Just rembering array methods is a good start for writing clean and reusable code.

In this post, like some of my others, I've explored some various array methods, such as push, pop, shift, unshift, map, filter, reduce, and many others. I've also tried to visually display them too.

Mutating Methods:

Methods that change the original array (e.g., push, pop, shift, unshift).

Iterative Methods:

Methods that iterate over each element of the array to produce a result (e.g., map, filter, reduce, some, every, find, findIndex).

Accessor Methods:

Methods that return a modified copy of the array or a specific element (e.g., reverse, at, slice, concat, includes, indexOf, join).

Flattening Methods:

Methods that flatten arrays (e.g., flat, flatMap).

Examples:




            

I’m here, learning and working away. If you liked this content and want to keep me going, consider buying me a coffee. Your support keeps this site running and the coffee brewing! ☕️