Last active
August 29, 2015 13:58
-
-
Save abbood/10108937 to your computer and use it in GitHub Desktop.
how to declare abstract classes within object declaration javascript
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
// the way it's done in the question (http://stackoverflow.com/questions/16963111/javascript-class-inheritance-for-functions/16963189#16963189) | |
MyBase = function() { | |
this.m_Stuff = 0; // etc | |
}; | |
MyBase.prototype.MySuperFunction = function (arg1) { | |
alert("Hello" + arg1); | |
}; | |
// how i would like to do it | |
MyBase = function() { | |
this.m_Stuff = 0; // etc | |
// define functions that can be overridden by subclasses | |
MyBase.prototype.MySuperFunction = function (arg1) { | |
alert("Hello" + arg1); | |
}; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment