Function overloading in JavaScript