A map, in functional programming, is for making a change to each element of a list. A built-in variable, also known as a predicate (or "pred"), may represent each element.
Depending on the language, the code can be arranged differently. map pred list; in Haskell and Scheme. map(pred, array); in Julia, Python, PHP, and R. array.map(pred); in JavaScript, Kotlin, and V (Vlang).
In the below, map is used to create a new array.
square x = x * x -- function to square each element
>>> map square [1, 2, 3, 4, 5] -- apply to each element
[1, 4, 9, 16, 25] -- new array with changes
array := [1, 2, 3, 4, 5]
new_array := array.map(it * it) // apply to each element
[1, 4, 9, 16, 25] // new array with changes
map in the Haskell Standard Preludemap in SRFI 1