"This" Works for Everyone


getting error ??

// here we define our method using "this", before we even introduce bob
var setAge = function (newAge) {
this.age = newAge;
// now we make bob
var bob = new Object();
bob.age = 30;
bob.setAge = setAge;

// make susan here, and first give her an age of 25
var susan={

// here, update Susan's age to 35 using the method


susan needs the same method assigned as bob had. Then it can be called on that object.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.