Most important things for today are:
- you can always check how many arguments function has in its declaration using length property,
- you can always check how many arguments function was invoked with by using arguments.length property.
A few ending thoughts:
- augmenting methods have some performance penalty,
- you’ll probably complicate stuff when use overloading too much,
- if you truly need that solution in JS, you’re doing something wrong :-)