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

276
Views
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 answers
Answer question

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