### map

#### map reporter-task list
(map reporter-task list1 ...)

With a single list, the given task is run for each item in the list, and a list of the results is collected and reported.

    show map round [1.1 2.2 2.7]
    => [1 2 3]
    show map [? * ?] [1 2 3]
    => [1 4 9]

With multiple lists, the given reporter is run for each group of items from each list. So, it is run once for the first items, once for the second items, and so on. All the lists must be the same length.

Some examples make this clearer:

    show (map + [1 2 3] [2 4 6])
    => [3 6 9]
    show (map [?1 + ?2 = ?3] [1 2 3] [2 4 6] [3 5 9])
    => [true false true]

See also foreach, ?.

Take me to the full NetLogo Dictionary