Last active
December 17, 2015 10:19
-
-
Save andrewebdev/5593576 to your computer and use it in GitHub Desktop.
Javascript: Object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function JSObject(options) { | |
var self = this, | |
defaultOptions = { | |
target: '#selector' // The target container selector | |
}; | |
// Extend the options, required to prepare this object before doing anything else. | |
if (typeof options === 'object') { | |
options = $.extend(defaultOptions, options); | |
} else { | |
options = defaultOptions; | |
} | |
// Private methods | |
function init(index) { | |
} | |
// Public methods | |
this.hello = function() { | |
console.log("Hello, World!"); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment