The following form is used in several plug-ins... var oGlobalObject; (function( externalObject) { ... code here, setup properties and methods on externalObject })( oGlobalObject );
so variable abc is defined as a global object with properties and methods.. Is the following form equivalent? var abc = function() { var oObject = {}; ... code here, setup properties and methods on oObject. return oObject; }(); It seems to me that one of these forms is more straightforward. Is there good reason to use one form over the other?