Javascript array methods made easy (Part I)

Today I’m going to look at 5 of the most used/useful javascript array methods. So, let’s get started.

map( )

This executes given function on every element of the array and return a new array.

array.map()

filter( )

This method creates and returns a new array with the elements which satisfies the condition in the given function.

array.filter()

reduce()

This array method considered as an accumulator function. This returns a single value.

array.reduce()

some( )

This method can be used to check if any item (even a single one) of the array satisfies the given condition.

array.some()

every( )

This is quite same as some() except this method evaluates all the elements in the given array.

array.every()

Useful Links