Count the Arguments

Published by Bjarte in

Create a method 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

Notes

  • If you get stuck on a challenge, find help in the Resources tab.
  • If you're really stuck, unlock solutions in the Solutions tab.
Watch a quick demo on how Edabit works.