16/33 - what's wrong?


#1

// 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;
// and down here we just use the method we already made
bob.setAge = setAge;

// change bob's age to 50 here
setAge(50);


#2

You need to write who is 50.
bob.setAge(50);


#3

Thank you, it worked!


#4

whats wrong with my code??

var bob = new Object();
bob.age = 30;

var.setAge = function (newAge) {
this.age = newAge;

};

bob.setAge(50);