JavaScript: Overloading functions by argument count