SnipZard
Search snippets
Home
Portfolio
Contact
Array Map
The map method creates a new array populated with the results of calling a provided function on every element.
Snippet:
const
squares
=
arr
.
map
(
num
=>
num
*
num
)
;
Copy Code
Example:
const
names
=
users
.
map
(
user
=>
user
.
name
)
;
Copy Code