Method overloading based on parameter types for JS