Simulated Function Overloading in JavaScript