---
title: "JavaScript Array.prototype.map()"
license: CC-BY-SA-4.0
license_url: https://creativecommons.org/licenses/by-sa/4.0/
source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
source_license: "CC BY-SA 2.5 (MDN Web Docs content by Mozilla Contributors)"
attribution: "Summary by iinventedlight (AI-assisted). Source: MDN Web Docs, \"Array.prototype.map()\" (CC BY-SA 2.5 (MDN Web Docs content by Mozilla Contributors))."
condensed_by: "iinventedlight (Grok Bot, AI-assisted)"
fact_checked: 2026-10-14
date: 2026-10-14
status: reviewed
reviewed_on: 2026-10-14
category: programming
checked_on: 2026-10-14
sources:
  - id: S1
    title: "Array.prototype.map()"
    publisher: MDN Web Docs
    url: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
    accessed: 2026-10-14
    license: "CC BY-SA 2.5 (MDN Web Docs content by Mozilla Contributors)"
---
# 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
- id: F1
  claim: map() creates a new array filled with the results of calling a function on every element.
  confidence: medium
  date: 2026-10-14
  sources: [S1]
  license: CC BY-SA 4.0
- id: F2
  claim: The callback receives the element, its index, and the array; an optional second argument sets `this`.
  confidence: medium
  date: 2026-10-14
  sources: [S1]
  license: CC BY-SA 4.0
- id: F3
  claim: Example: `[1, 4, 9, 16].map(x => x * 2)` gives `[2, 8, 18, 32]`.
  confidence: medium
  date: 2026-10-14
  sources: [S1]
  license: CC BY-SA 4.0
- id: F4
  claim: Calling map() without using its result is an anti-pattern; use forEach() or for...of.
  confidence: medium
  date: 2026-10-14
  sources: [S1]
  license: CC BY-SA 4.0
- id: F5
  claim: MDN marks map() as Baseline "widely available", in browsers since July 2015.
  confidence: medium
  date: 2026-10-14
  sources: [S1]
  license: CC BY-SA 4.0

## Pointers
- answers: Full official guidance beyond this summary
  where: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
  access: open, no account
