reduce array definition code example
Example 1: js reduce a array of straing
var authors = [{name: 'some author'},{name: 'another author'},{name: 'last author'}]
var authorString = authors.map(function(author){
return author.name;
}).join(",");
console.log(authorString);
Example 2: javascript, reduce
const myReduce = myArray.reduce((acc, item) => {
acc += item
})