Repeating what other posters said about a browser providing function arguments, I would like to make a general remark about javaScript as a language. JavaScript, unlike languages ββsuch as C ++ and Java, does NOT apply to parameters defined in a function signature. This means that you can have a function such as:
function doSomething(myParam){ ... Does Some Stuff }
Then call it in any way below:
doSomething(); doSomething(foo); doSomething(foo, bar); doSomething(foo, bar, baz);
etc..
If it is called without parameters defined in the signature, the missing parameters will be undefined. Additional parameters can only be accessed by the args array, which has all the functions.
I know this was not specific to your question, but I thought it might be useful for context and general interest.
dball917
source share