javascript reduce method array to object code example
Example: .reduce mdn
arr.reduce(callback( accumulator, currentValue[, index[, array]] )[, initialValue])
arr.reduce(callback( accumulator, currentValue[, index[, array]] )[, initialValue])