The map() method is used to apply a function on every element in an array and then return a new array. You can use the current value, current index or even the entire array to determine what to return. The filter() method can be thought of as a for loop, that is specifically for transforming values.

2m read timeFrom rahulism.hashnode.dev
Post cover image
2 Comments

Sort: