What's wrong with 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;

// here, update Susan's age to 35 using the method
susan.setAge = setAge;
setAge = susan.setAge(35);

The console tell me to 'Make sure to set susan's setAge property to be the setAge function' but I can't find any error in my code. Please help me to solve this.



setAge = susan.setAge(35);

why setAge =? It will overwrite the function.


Thanks, I solved the problem by removing setAge