/ Published in: JavaScript
Expand |
Embed | Plain Text
function theObject(){} (function() { // private properties var THIS = this; var options = { x : 123, y : 'abc' }; // private properties setter this.define = function(key, value) { if(defined(options[key])) options[key] = value; }; // private method function defined(x) { return typeof x != 'undefined'; } // public properties this.ready = false; // public method this.init = function() { this.ready = true; }; }).apply(theObject); // set this to MyScrip object
You need to login to post a comment.
