Working with JavaScript Arrays

For Loop

ForEach Function

The forEach() method calls a provided function once for each element in an array, in order.
Note: forEach() does not execute the function for array elements without values.

Map Function

The map() method creates a new array with the results of calling a function for every array element.
The map() method calls the provided function once for each element in an array, in order.
Note: map() does not execute the function for array elements without values.
Note: map() does not change the original array.
https://www.w3schools.com/jsref/jsref_map.asp

Using a named function

Using an anonymous function

Using shorthand pointer notation

Using an array of JSON objects

Using an array of JSON objects

Filter Function

The filter() method creates an array filled with all array elements that pass a test (provided as a function).
Note: filter() does not execute the function for array elements without values.
Note: filter() does not change the original array.
https://www.w3schools.com/jsref/jsref_filter.asp

Using a named function

Using an anonymous function

Using an array of JSON objects

Reduce Function

The reduce() method reduces the array to a single value.
The reduce() method executes a provided function for each value of the array (from left-to-right).
The return value of the function is stored in an accumulator (result/total).
Note: reduce() does not execute the function for array elements without values.
https://www.w3schools.com/jsref/jsref_reduce.asp

Using a named function

Using an anonymous function

Using an array of JSON objects

Get Unique Array of JSON Objects

Sort Array of JSON Objects

Nested JavaScript Map Function and Non-Mutated Copying of Object Raw

Array Methods

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array