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

153
Vistas
Are these 2 JavaScript statements equivalent?

These 2 statements seem to do the same thing.

const handleClick = () => alert('foo');

and

function handleClick() {
    alert('foo');
}

Are they identical and just syntactically different? The first one looks like a variable declaration, whereas the second one is clearly a function definition.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

No, they are not the same thing. The arrow function has some limitations:

  • Does not have its own bindings to this or super, and should not be used as methods.
  • Does not have new.target keyword.
  • Not suitable for call, apply and bind methods, which generally rely on establishing a scope.
  • Can not be used as constructors.
  • Can not use yield, within its body.
about 4 years ago · Juan Pablo Isaza Denunciar

0

ES6 arrow functions provide you with an alternative way to write a shorter syntax compared to the function expression. There is no performance difference.

Are arrow functions faster (more performant, lighter) than ordinary standalone function declaration in v8?

about 4 years ago · Juan Pablo Isaza 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