26 passing arguments dont know what to do


#1


it says Make sure to set myBalance equal to calling john's askTeller method with 1234 as the argument


Replace this line with your code. 
function Person(first,last,age) {
   this.firstname = first;
   this.lastname = last;
   this.age = age;
   var bankBalance = 7500;
  
   this.askTeller = function(pass) {
     if (pass == 1234) return bankBalance;
     else return "Wrong password.";
   };
}

var john = new Person('John','Smith',30);
/* the variable myBalance should access askTeller()
   with a password as an argument  */
var myBalance = askTeller(1234);


#2

you cant access method like that.
it should be

John.askTeller(1234);


#3

thanks so much for yor help


#4

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