map(), forEach(), and filter() are the array method in es6 in Js.
which is work on - each element of array.
-
map()-
transforms each element of array and returns a new array.
Usege -
When we try or need to
modified array.
-
forEach() –
loops over elements but does
not return anything
in the array.
Usege -
When you just need to use loop over elements
like as for-loop.
-
filter() –
also returns a new array,
only the filtered elements that Pass
by a specific Condition.
Usage -
When we need to filtered any element of the array.