Is there a reliable way of getting the instance of a JavaScript object?
For example, relying on the fake 'obj.getInstance()
' function.
var T = {
Q: {
W: {
C: function() {}
}
}
};
var x = new T.Q.W.C();
console.log( x.getInstance() === T.Q.W.C); // should output true
If this is not part of the ECMA specification, please include browser/node.js support and compatibility in answers.