Javascript array methods made easy (Part I)

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

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store