17 Error but no error?


// 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;
susan,setAge = setAge;
// here, update Susan's age to 35 using the method

Okay so this is my code and the error message TypeError: susan.setAge is not a function what could I be doing wrong?


Comma instead of period on this line. :slightly_smiling:


Omg I can't believe I made such a small mistake on this. -.- Thanks @cadecodes


Welcome! When coding, even the smallest errors can break your program. :slightly_smiling:

P.S. Nice picture! :wink: