Why bob.setAge = setAge;?


#1

Why is so importatn that we set:
bob.setAge = setAge;
susan.setAge = setAge;

I dont understand that part.
Can some1 explain me?

// 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;
susan.setAge(35);

#2

If you want them to have their own values, then you'll have to give that to them.


#6