JavaScript Array#map(), reduce(), and filter()

In The Trouble With Loops I found these nice and simple examples covering Array#map(), Array#reduce(), and Array#filter(). const dollars = [32, 45, 50]; // map(): When you want to translate values in an array into another set of values. const euros = dollars.map(eachAmount => eachAmount * .93); // reduce(): When you want a total based …