Editing JavaScript/Notes/Singleton
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 51: | Line 51: | ||
</source> | </source> | ||
The function scope allows us to hide variable `b`. | |||
[http://jsbin.com/ErAHEFo/1/edit jsbin] | [http://jsbin.com/ErAHEFo/1/edit jsbin] | ||
An object literal does not allow information hiding: | |||
<source lang="javascript"> | <source lang="javascript"> | ||
// exposed variables. | // exposed variables. |