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

164
Views
Is there a way to use const using traditional function declaration

I am new to JS and still a newbie. So I am learning new ways of using functions in JS like the arrow fucntions. const func= () => {}

We can use var and const in arrow functions Is there any way to use it the traditional function declaration methods like -

function func() { }

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Among dozens of different ways of declaring a function the following 2 are the most commonly used (and favored by the JS community:

  1. Arrow Function: const Foo = () => {}
  2. Regular Function: function () {}

And that is why you almost always see the above formats throughout the not only the beginning, but also the rest of your programming career! But that does not, necessarily, mean you cannot use some other alternatives i.e. "const/var in traditional way of declaring"

One good example can be a named function expression:

const count = function(array) { // Function expression
  return // something;
}

For a better understanding, I would suggest checking out the following blog post: 6 Ways to Declare JS Functions

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!