Creating a Class / Object with JQuery
Hello
I know this is really basic, but can someone point me in the right direction? I'd like to create a JS class/object where "this" is a reference in the object to its properties and methods. Something like this - only I haven't quite got it:
- var nameOfClass = ({
- function nameOfClass(options) {
- //code here
- },
- nameOfClass.prototype = {
- initialize: function(options) {
- //first method
- },
- run: function() {
- //another method and so on
- }
- }
- return nameOfClass;
- })();
What am I doing wrong - and how do I call this class once I've got it created properly?
Thanks a lot guys!!