← BYTES
JavaScript·Intermediate·Ref: 3.2.4
What do Array methods like `map`, `filter`, and `reduce` have in common?
Have a question about this video? Mention reference 3.2.4 when you contact us.
a.They all mutate the original array in place
b.They all run asynchronously
c.They can only be used with arrays of numbers
d.They are all non-mutating (return a new array or value) and take a callback function describing what to do with each element
map, filter, and reduce are core functional-style array methods -- none of them mutate the original array (they return a new array, or in reduce's case, an accumulated value), and all take a callback function that's applied per element, encouraging a declarative style over manual for-loops.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES324#JavaScript