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

204
Views
Declaration of functions in JavaScript as constants

Why do we use "const" declarator in declaration of functions in Javascript?


     const functionName= () => {
           ...
        }

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

0

const functionName = () => {
       return 15;
    }

Here an anonymous(lambda) function's result is assigning to a constant variable 'functionName'. Just like const x = 5;

Lambda functions are used when you need a function for a short period of time. It has no function name. This is commonly used when you want to pass a function as an argument to higher-order functions, that is, functions that take other functions as their arguments.

about 4 years ago · Juan Pablo Isaza Report

0

// Function declaration
function add(){
}
// A variable declared
const add=()=>{
}

Function promotion occurs in function declarations,Variable declarations are not promoted

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!