Passing Arguments


Oops, try again. Make sure to set myBalance equal to calling john's askTeller method with 1234 as the argument

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 = john.askTeller('1234');

So many refreshes, but it didn't worked!



var myBalance = john.askTeller(1234);


good catch, the pincode should be represented as integer, not as string


I think that

var myBalance = john.askTeller('1234');

also should works because for checking password was used ==:

if (pass == 1234) return bankBalance;


from a technical point of view, yes, but it seems the validation wants the passcode as integer.


Oh gosh. I didn't think about it
Thanks guys.