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

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

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 Relatório

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 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