Thank you,
very nice article.
About map, I find a bit confusing the use of the remove concept in this sentence:
That is: you pick each ball,
removethe rating tag and dump it into another box.
Probably I am taking that remove too literally but, in my understanding, map does not remove from the temporary item: instead it "borrows" a copy of something from that temporary item to apply a manipulation on it and, thereafter, add it to (another box).
tags = balls.map(ball => {
ball.rating;
console.log("temp ball after collecting rating: ", ball);
});
output:
temp ball after collecting rating:
Object { brand: "Adidas", color: "blue", rating: 5 }
debugger eval code:3:11
temp ball after collecting rating:
Object { brand: "Konami", color: "red", rating: 4 }
debugger eval code:3:11
temp ball after collecting rating:
Object { brand: "Verah", color: "blue", rating: 2 }
debugger eval code:3:11
temp ball after collecting rating:
Object { brand: "Adidas", color: "green", rating: 3 }
Any suggestion?