← Back to challenges

Return the Total Number of Parameters

JavaScriptHardlanguage_fundamentals

Instructions

Create a function that returns the total number of parameters passed in.

Examples

numberArgs("a", "b", "c") ➞ 3

numberArgs(10, 20, 30, 40, 50) ➞ 5

numberArgs(x, y) ➞ 2

numberArgs() ➞ 0

Notes

  • How can you express the input parameter so it takes a variable number of arguments?
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Return Types