Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!