Difference between revisions of "Sandbox"

From Organic Design wiki
m
m
Line 6: Line 6:
 
     return {
 
     return {
 
         foo: function() {
 
         foo: function() {
             var private = 'secret message';
+
             private = 'secret message';
 
             this.public = 'not secret';
 
             this.public = 'not secret';
 
         },
 
         },
Line 15: Line 15:
 
} )();
 
} )();
 
closure.foo();
 
closure.foo();
alert( closure.public );
+
alert(private);
alert( closure.private );
 
closure.bar();
 
 
});
 
});
  
 
</script></html>
 
</script></html>

Revision as of 15:40, 12 September 2012