Reading map() πΊοΈ
Next you'll transform whole lists at once with .map(). Let's read it first.
.map() builds a new array by running a little function on every item. The
original array is left untouched.
[1, 2, 3].map((n) => n + 1); // [2, 3, 4]
That (n) => n + 1 is an arrow function β a quick way to say "take n, hand
back n + 1." map runs it once per item and collects the results into a new array.
Read each snippet and predict the new array. π