array reducer, create array code example
Example 1: js reduce
let newArray = array.reduce( (acc, element, index, originalArray) => {
// return acc += element
}, initialValue)
Example 2: array reduce
arr.reduce(callback( accumulator, currentValue[, index[, array]] ) {
// return result from executing something for accumulator or currentValue
}[, initialValue]);