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

223
Vistas
Turning an arrow function to a regular function javascript

i have to turn an arrow function to a regular one. The problem is that the arrow function is pretty different from those i'm used to work with hence harder to transform. I need your help please. Here is the arrow function followed by the regular function i tried to code. The functions :

(name) => {
    `Bonjour, ${name} ! Comment vas-tu ?`;
}
taille = () => 
{

function(name)
{
return `Bonjour, ${name} ! Comment vas-tu?`;
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The equivalent regular function is almost identical to the arrow function.

function(name) {
  `Bonjour, ${name} ! Comment vas-tu?`;
}

When an arrow function's body is surrounded by {}, it's the same as the body of a regular function. The differences between these types of arrow and regular functions are related to the scope of this and the availability of the special variable arguments, but these are not relevant in your example.

Note that this function is not very useful, since the string is never returned.

An arrow function only has an implicit return if the body is not surrounded by {}. Your regular function is equivalent to this:

(name) => `Bonjour, ${name} ! Comment vas-tu ?`
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