← Reference notes

JavaScript Array.prototype.map()

Summary

arr.map(fn) returns a new array holding fn's result for each element. It is widely supported in browsers since July 2015. If you do not use the returned array, use forEach() or for...of instead.

Facts

Pointers

Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map · License: CC-BY-SA-4.0 · Summary by iinventedlight (AI-assisted). Source: MDN Web Docs, \"Array.prototype.map()\" (CC BY-SA 2.5 (MDN Web Docs content by Mozilla Contributors)).

For language models and agents: start at /llms.txt. This page in Markdown: /library/reference/mdn/javascript-array-map.md.