17 / 33 not understanding one little part


#1

Hi guys, i have a little question.. i have this code(it works fine)

// 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 = {
age: 25
}
susan.setAge = setAge;

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

Why do have to declare this part?
susan.setAge = setAge;


#2

We use "susan.setAge" to say that when we say "setAge" on Susan, it will make a new age for her, as shown in the function called "setAge". Basically, doing that activates the function and clarifies what it is working for.


#3

Watch here
// make susan here, and first give her an age of 25
var susan = new Object();
susan.age = 25;
susan.setAge = setAge; // setAge - it's a susan.setAge, but shortly!
// here, update Susan's age to 35 using the method
susan.setAge(35); // This is a changing a susan.age data!