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

277
Visualizações
Arguments Object is Empty Despite Setting Default Argument Value – is there a Workaround?

Given this function (e.g. in node.js)

> function f (a = 1) { return arguments; }
undefined
> f(1)
[Arguments] { '0': 1 } // arguments object contains value for argument a
> f()                  // invoke function f without argument
[Arguments] {}         // arguments object is empty despite default value

I need to be able to obtain default values if no argument is given.

Can anybody help me with this?

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

0

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

This means that arguments will only hold the values that are actually passed to the function when a call is made.

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