Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

4

725
Vistas
What does the map method do?

In JS map it is responsible for generating a response array from a function applied to an input array

over 4 years ago · José Alejandro Vargas Gutiérrez
12 Respuestas
Responde la pregunta

0

Basically it allows you to loop through an object and/or an array of objects in a new item.

over 4 years ago · Sergio Andres Campbell Villarreal Denunciar

0

Basically it allows you to loop through an object and/or an array of objects in a new item.

over 4 years ago · Sergio Andres Campbell Villarreal Denunciar

0

Iterates through an object but returns numbers different from the original object

over 4 years ago · Jesus Miguel Tirado Puello Denunciar

0

map allows you to manipulate an array response more efficiently without having to normally generate loops and whiles to iterate through all the vector items

over 4 years ago · Juan Burgos Herrera Denunciar

0

CREATE A NEW ARRANGE STARTED WITH ANOTHER

over 4 years ago · MARVIN BLAS DE LA PEÑA GUZMAN Denunciar

0

acts as a for

over 4 years ago · Valeria Lucia Navarro Garcia Denunciar

0

In a nutshell, it walks through the placed array.

over 4 years ago · Iosef Dali Ayala Huaringa Denunciar

11

In more descriptive terms it creates a new array with the results applied in the method.

Example:

We are going to map an array to find the numbers greater than 2.

we have our first array that we will call array1

 array1 = [1, 2, 3, 4]

To create the map method is as follows:

yourArray.map (receivesAnItem => returnsTheResultAppliedToYourElements)

So we're going to use the map method to find out which numbers are greater than 2.

 newArray = array1.map(num => num > 2)

This would return:

 console.log(newArray); result: [false, false, true, true]

In cases more developed in the labor field, it is used a lot for JSON, such as:

 myJson = [ { "name": "Pepito", "age": 20, }, { "name": "Juan", "age": 28 } ]

Let's map this JSON to get the names.

 newJson = myJson.map(item => item.name)

This would return a new array with the elements that would be the names.

 console.log(newJson); result: ['Pepito', 'Juan']

over 4 years ago · Santiago Trujillo Denunciar

4

It goes through an array and returns a new one, with the result of the operations or processes applied to each item of the collection.

over 4 years ago · Yesid Dávila Sierra Denunciar

5

The map method in Javascript allows us to use an array to create a new one, which is the result of the return of a function that we pass as an argument, in said function we can do any process on each element of the array, to then return an element that will be part of the new array.

 let nums = [1,5,6,8,7] let powOddNums = nums.map(function(element){ if(element % 2 !== 0 ){ return element * element } return element }) result: [1,25,6,8,49]
over 4 years ago · Carlos Yeric Fonseca Rios Denunciar

1

The textual definition indicates that it creates a new array from an existing one, but this relative to what we do in the callback function is passed as an argument, you can even use the map without taking the result to a variable (myArray.map(element => {only view element})).

In conclusion, the map method loops through an array, extracting each element of an existing array in order.

over 4 years ago · Edwin Arley Gomez Mendez Denunciar

1

The Map object holds key-value pairs and remembers the original insertion order of the keys. Any value (both objects and primitive values) may be used as either a key or a value.
A Map object iterates its elements in insertion order — a for...of loop returns an array of [key, value] for each iteration.

Objects vs. Maps

Object is similar to Map—both let you set keys to values, retrieve those values, delete keys, and detect whether something is stored at a key. For this reason (and because there were no built-in alternatives), Object has been used as Map historically.

However, there are important differences that make Map preferable in some cases:

If you want to learn more about map of javascript, please read this article.....
Good Luck...

over 4 years ago · Marko Kujacic Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda