Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda