Is there any way to access a function which is inside a function, which is inside an other function in JavaScript?
function x(name, age) {
this.name = name;
this.age = age;
this.a = function() {
this.b = function() {
return "b";
};
return "a";
};
}
var xobj = new x('vin', 25);
console.log(xobj.a.b()); //error
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…