Understand complex array functions

Some of the built-in functions of arrays in JavaScript are multi-functional and sometimes difficult to understand.

1. reduce is used to make some kind of change to an existing array and eventually produce a value.

2. forEach vs Map. ForEach is focusing on each element, supporting a variety of operations on each. Map focuses on creating a specific new array with the array.

3. Sort functions do not directly sort-able and need to provide a callback to specify how to sort, such as descending order or ascending order.

4. If you’re new to using these functions, rewrite the MDN example directly and will become familiar over time.

Understand complex array functions.