My programing background is that I learned a little Java in school. JavaScript syntax tends to confuse me for some reason. The JavaScript code below is a pattern of syntax that I don’t know what to make of:
foo.ready = function(variable){... var whatever = variable.bar();
One of my main points of confusion is the parameter. For a contrasting example, in Java, if I call a method with one parameter, the call sends one parameter. I don’t see how the parameter named ‘variable’ is ever set.
The
variableis assigned whenfoo.readyis invoked, and passed some value (presumably a function).Here’s a working example: http://jsfiddle.net/69grz/