//new object
function A() {
this.first = "one";
this.second = "two";
this.third = "three";
}
//add the 'typing' object to our object
A.prototype.myType = {
firstType : function() {
},
secondType : function() {
//how do I alter the value of function A's "second" property from
here?
// 'this' is scoped to the current object
},
thirdType : function() {
}
}
B = new A();
var typeIt = "secondType";
if (typeIt in B.myType) {
B.myType['typeIt'];
}
|