I use this to create several classes and create some inheritance structure.
var ControlType = Class.extend({ init: function(){ }, html: function(type){
Now I was wondering if it is possible to get the subclass type in ControlType.html without passing it explicitly?
Update:
I tried this.constructor without an extension of functionality, as someone suggested, but this returns the type of the parent class. So, in the following example, the console registers Person (), but I need Jimi ().
function Person(){ this.say = function(){ console.log(this.constructor); } } function Jimi(){ this.name = 'Jimi'; } Jimi.prototype = new Person(); var j = new Jimi(); j.say();
source share