Why does it say this but john is a Person in my code?


#1



Error Message: Make sure john is a Person


function Person(first,last,age) {
this.firstname = first;
this.lastname = last;
this.age = age;
var bankBalance = 7500;

var returnBalance = function() {
return bankBalance;
}

// create the new function here
this.askTeller = function() {
return returnBalance;
};
};

var john = new Person('John','Smith',30);
console.log(john.returnBalance);
var myBalanceMethod = john.askTeller();
var myBalance = myBalanceMethod();
console.log(myBalance);


#2

Code seems fine. Maybe refresh?


#3

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