Arrays

Array.map()

Learn how to use Array.map() in JavaScript.

Array.map()

Documentation for Array.map() in JavaScript.

Syntax

arr.map(x => x * 2)

Example

// Practical usage
arr.map(x => x * 2)
console.log("Executed successfully.");

Notes

JavaScript provides powerful built-in methods for the web.

Try It Yourself

You can run JavaScript directly in the BrowserCode Playground.