17/33 please help


#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;
bob.setAge = setAge;

// make susan here, and first give her an age of 25
var susan = new Object();
susan.age = 35;
susan.setAge = setAge;
// here, update Susan's age to 35 using the method
var setAge = function (newAge) {
this.age = 35;
susan.setAge(35);
}


#2

Hi @mr_cheese_47

Your objects are right, but look what I changed in your function :

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

var susan = new Object();
susan.age = 25;
susan.setAge = setAge;

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

susan.setAge(35);

#3

when i put it it says Oops, try again. Make sure to set susan's setAge property to be the setAge function


#4

Ok try this:

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

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

var susan = new Object();
susan.age = 25;
susan.setAge = setAge;

susan.setAge (35);

#5

thank you it worked i just misspell susan


#6

A way to avoid that is to click and drag over the code, then hit the command button on your computer. While holding it, hit "c". That text will be copied to the computer until you're ready to use it. Then, you can put it in the coding area by pressing the command button and holding again, but this time hitting "v". This pastes the selected text to where you want it. Why "v"? Because we use command "p" for printing things. I'm a computer nerd, so I know about these tricks.
Hope it helped.