Object.Method = Method


In the Instruction it is given as

susan.setAge method also equal to setAge

otherwise it is an error .. can anyone explain the meaning of that line of code as below
var setAge = function (newAge) {
this.age = newAge;
var susan ={
age : 25
susan.setAge = setAge;

So what is the significance of susan.setAge = setAge; ??


hi, i'm starting too with js. This method can be used from all objects that you like, but for every object, you must explain to use the method.


Significance is that

susan.setAge = setAge;

will set objectName.setAge equal to setAge variable that we defined is a function.