JS - Arrays and Functional Methods
Arrays store ordered collections of values. Functional array methods are used to loop, transform, filter, and reduce arrays.
Core Notes
Method Summary
| Method | Returns | Use when |
|---|---|---|
forEach() | undefined | doing something for each item |
map() | new array | transforming each item |
filter() | new array | keeping matching items |
reduce() | one value | accumulating into a total/object/string |
sort() | sorted original array | ordering items |