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

136
Visualizações
JS arguments vs parameters

Different sources explain it in a different ways. In the below example, which are arguments and which are parameters?

 const add = function(number1, number2){
       return number1 + number2
           }

    add(3,10)

thanks!

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Edit: as another user pointed out, this is a duplicate. What is the difference between arguments and parameters in javascript?


Arguments are what's passed to a function at runtime. Parameters are what are defined in the function definition and alias the arguments.

Parameters are variables listed as a part of the function definition.

Arguments are values passed to the function when it is invoked.

Source: https://codeburst.io/parameters-arguments-in-javascript-eb1d8bd0ef04

function moo(number1, number2) {} // parameters are defined

moo(10, 50, 100); // arguments are passed.
// notice that more than the specified number of parameters
// can be supplied and accessed via 'arguments'

Also see arguments:

arguments is an Array-like object accessible inside functions that contains the values of the arguments passed to that function.

about 4 years ago · Juan Pablo Isaza Relatório

0

Parameters are variables listed as a part of the function definition. Arguments are values passed to the function when it is invoked.

const add = function(number1, number2){ //Arguments
   return number1 + number2 //Parameters
       }

add(3,10)
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