(Back to Lecture)
map(Function, List) = apply Function to each element of a list to yield a new list
map(Function, List)
= apply Function to each element of a list to yield a new list
e.g.
map(sq, [1, 2, 3, 4]) ==> [1, 4, 9, 16] map(cube, [1, 2, 3, 4]) ==> [1, 8, 27, 64]
map(sq, [1, 2, 3, 4])
==> [1, 4, 9, 16]
map(cube, [1, 2, 3, 4])
==> [1, 8, 27, 64]