You can’t do it in JavaScript. You can in C# and there are a couple of methods.
A string is converted into a GUIStyle because an implicit cast operator has been defined for it, that’s how you can have one parameter appearing to take two different types of value.
A parameter can be optional if you define it with a default value, such parameters must come last in the list.
You are better off having multiple methods in JavaScript which each have a different signature corresponding your desired parameters.