Map method in JavaScript

Photo by GeoJango Maps on Unsplash
  1. Creates a new array.
  2. Iterates through an array.
  3. Runs a callback function for each element in the array.
  4. Adds the result of that callback function to the new array.
  5. Returns the new array.
  1. Triple the value of each element in the given array.

--

--

--

Web Developer/ Front-end engineer who loves solving Rubik's Cube

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Java to ES6 Javascript

Host Apache + Vhost + SSL — Monterey (OS 12)

SMS News Feed

npm weekly #140: How we rebuilt npmjs.com,

Javascript New Features | ES8(ECMA 2017) features

Creating a REST API with NestJS — Part 04 — Quick Adding a Dockerfile with Reduced Image Size

https://www.youtube.com/watch?v=pfX3sR8tCAc

Don’t forget content type

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nilesh Saini

Nilesh Saini

Web Developer/ Front-end engineer who loves solving Rubik's Cube

More from Medium

DFS in JavaScript (Data Structures)

JavaScript: Object

Working with Nested Objects in JavaScript

Recursion for beginners (in JavaScript)