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

0

133
Vistas
Where are the callback parameters coming from in a recreation of a .map prototype function?

I'm recreating Javascript's map function and i'm not understanding where these parameters are coming from:

(this[index], index, this)

I understand what this is the array, i understand this[index] is the value, and index is the number that keeps track of the index on iteration, but where is that all coming from when i'm only passing in:

x => x * 5

that's the part i'm confused about and havne't found a good explanation about it online.

Array.prototype.mymap = function(callback) {
    const resultArray = [];
    for (let index = 0; index < this.length; index++) {
        resultArray.push(callback(this[index], index, this));  // confused about these parameters
    }
    return resultArray;
}

const sample = [1,2,3];    
var output = sample.mymap(x => x * 5);    
console.log(output);
about 4 years ago · Juan Pablo Isaza
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