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

173
Vistas
what are the steps javascript engine take when it encounters a wrapper function

I came across this code while trying to understand how the JavaScript engine interprets wrapper functions. I want to know what are the steps the engine takes when it executes wrapper function code and i want to know what the this refers to in the context of a wrapped function when it is passed around to another variable that executes it later.

function profile(func, funcName) {
       return function () {
    var start = new Date(),
      returnVal = func.apply(this, arguments),
      end = new Date(),
      duration = stop.getTime() - start.getTime();

    console.log(`${funcName} took ${duration} ms to execute`);
    return returnVal;
  };
}

var profiledMax = profile(Math.max, 'Math.max');
profiledMax.call(Math, 1, 2);
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