Skip to content

Conversation

@SihamNafie24
Copy link

Description

This pull request clarifies that Array.prototype.map() does not mutate the original array and instead returns a new array.

Motivation

This clarification helps avoid confusion for readers who may assume that map() modifies the existing array, especially beginners learning JavaScript array methods.

Additional details

No functional changes were made. This is a documentation-only improvement.

Related issues and pull requests

@SihamNafie24 SihamNafie24 requested a review from a team as a code owner January 29, 2026 20:12
@SihamNafie24 SihamNafie24 requested review from Josh-Cena and removed request for a team January 29, 2026 20:12
@github-actions github-actions bot added Content:JS JavaScript docs size/xs [PR only] 0-5 LoC changed labels Jan 29, 2026

{{InteractiveExample("JavaScript Demo: Array.prototype.map()")}}

> **Note:**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mdn-linter] reported by reviewdog 🐶

Suggested change
> **Note:**
> **Note:**


{{InteractiveExample("JavaScript Demo: Array.prototype.map()")}}

> **Note:**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
error search-replace Custom rule [gfm-alert: Use the GFM syntax: https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Howto/Markdown_in_MDN#notes_warnings_and_callouts] [Context: "column: 1 text:'> Note:'"]

Updated note about Array.prototype.map() to clarify it does not modify the original array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:JS JavaScript docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant