#17. This works for everyone help



It keeps saying "Make sure to change susan to 35", when I already did so.
this is my code

// 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 = 25;
susan.setAge = setAge;
// here, update Susan's age to 35 using the method

can anyone tell me whats wrong with the code?


Hello @coursepro35324,

When you have defined a method for an object like bob or susan, you don't have to use the equality operator. Instead, you can use pass the number directly in as a parameter, like so


Hope this clears things up...

Barry Allen


Thank you, that helped so much!


No worries @coursepro35324! Keep coding hard :smile:! And if you feel that I have resolved your query, then please leave my post as the solution to the topic so that others know that it is closed. Keep coding hard :smile:!


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