More details:
> var bar = {
In javascript, declarations are processed first so that the bar exists as a variable before execution starts.
> alert: function () { > window.alert('Ohai Mark!'); > }, > init: (function () { > bar.alert(); > }())
Line
a value will be assigned after , the expression on the right side is calculated. During this assessment, the bar has any value that it had on reaching the statement (the entire line). It is currently undefined, and therefore it does not yet have a warning property.
> };
source share