Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 970 Bytes

map-function.md

File metadata and controls

33 lines (23 loc) · 970 Bytes

map function

map is a function that takes another function as an argument, along with a collection.

map calls the function provided to it on each member of the collection, then returns a new collection with the results of those function calls.

This may feel a strange concept, but it is at the core of Clojure and functional programming.

(map even? [0 1 2 3 4])

Note::Count the size of words in a collection

Count the number of characters in each word for a collection of strings eg. ["a" "abc" "abcdefg"]

()
(map count ["a" "abc" "abcdefg"])

Hint::Functions to try with map