+ 4
Please what is the difference between map(), filter() and reduce() array method in Javascript
3 Antworten
+ 2
I highly recommend to do research by yourself, simply google it. If those articles seems hard for you, use someone`s Youtube explanation with simple examples.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
+ 2
Map performs an operation on each element in the array, much like foreach.
Filter, like it says filters out the result based on some criteria e.g. all items less than 5
Reduce performs a summing operation on the array
+ 2
Thanks