25 Private Methods (Quick Question Please)



Hi, Ive managed to pass the lesson but i just wondering why we have to create the var MyBalanceMethod just to then create the variable "MyBalance".

In my head it just seems that john.askTeller = myBalanceMethod = myBalance, so why do we need to middle man "myBalanceMethod"?

I did try just using console.log(myBalanceMethod) but it just return as function.

If anyone can just quickly explain this so i can fully get my head around it that would be great.


var myBalanceMethod = john.askTeller();
var myBalance = myBalanceMethod();


Because askTeller returns a method, we need to call it to make it any use. This is what

var myBalance = myBalanceMethod();

you can use


too.just remember you need to call it.askTeller returns the returnBalance method. This means that it returns the method itself and NOT the result of calling that method.