Notes
- You can prettify your JSON output by passing null and the number of spaces to indent.
- Another useful high order function you can use is reduce which combines the elements of an array to a single value.
- The logic that each function (map, filter reduce) calls to manipulate the original array of data is called a closure. Note that there is no formal function declaration and no function name for a closure.
This work is licensed under the Creative Commons Attribution 3.0 Unported License.