var friends = [
{ name: "Anna", books: ["Bible", "Harry Potter"], age: 21 },
{ name: "Bob", books: ["War and peace", "Romeo and Juliet"], age: 26 },
{ name: "Alice", books: ["The Lord of the Rings", "The Shining"], age: 18 }
]
var allbooks = friends.reduce(function(prev, curr) {
console.log(prev);
console.log(...prev); // опа!
return [...prev, ...curr.books];
});