Difference between revisions of "Sandbox"
From Organic Design wiki
m |
|||
| Line 3: | Line 3: | ||
$(document).ready( function() { | $(document).ready( function() { | ||
| − | + | var closure = ( function() { | |
| − | + | var foo = 1; | |
| − | + | return { | |
| − | + | bar: 100, | |
| − | alert( | + | baz: function() { |
| + | foo2 = 'yo'; | ||
| + | } | ||
| + | } | ||
| + | } )(); | ||
| + | closure.baz(); | ||
| + | alert( closure.foo2 ); | ||
}); | }); | ||
</script></html> | </script></html> | ||
Revision as of 15:22, 12 September 2012



