← Back to challenges

Count the Arguments

JavaScriptHardlanguage_fundamentalsfunctional_programming

Instructions

Create a function that returns the number of arguments it was called with.

Examples

numArgs() ➞ 0

numArgs("foo") ➞ 1

numArgs("foo", "bar") ➞ 2

numArgs(true, false) ➞ 2

numArgs({}) ➞ 1
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Find the Bug: Returning the Container