This doesnot works for everyone


Oops, try again. It looks like you have an error in your code. Here's the message: TypeError: susan.setAge is not a function

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


Read the error message and consider how what it describes is different from what is supposed to happen, what are you looking to change about its behaviour?

What information do you need to solve this problem? Ask for that. We don't know what you're missing.


Its not working . susan age is not update to 35. :frowning: please help


Can you describe what chain of events would cause susan's age to update to 35?

And once you've established that, you can start confirming whether those things are happening


accessing susan.setAge property and set it to 35 through this code should set its age to 35 but its not working.


What is your error message saying about that?

Is it supposed to be a function? If so, that's what's wrong right? You would need to check the code that makes it refer to a function


hey it worked
changed susan.setAge = setAge(); to susan.setAge = setAge;

but i dont get it.. :sweat: why do i need to set the setAge property of susan to setAge function.
if i am using another property like set it does not work???


What did you write?
What effect was it supposed to have?
What effect did it have instead?

If you mean that you called a property that you had not created, then I don't understand why that would work in any sense?


No i created that property earlier that's why it worked


I can't tell if you're asking something or not. Insufficient information.


Please read the explanation


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