when it goes to line 21 it thinks there is no function deposit I am confuced as it should have that function. Please explain why.
1 function makeBankAccount(){
2 var bala = 0
3 function balance(b)
4 {
5 return bala;
6 }
7 function withdraw(b)
8 {
9 bala = bala - b;
10 }
11 function deposit(b)
12 {
13 bala = bala + b;
14 }
15 return makeBankAccount;
16 }
17
18 var account1 = makeBankAccount();
19 var account2 = makeBankAccount();
20
21 account1.deposit(5);
22 console.log(account1.balance()); // -> 5
23 account1.withdraw(5);
24 console.log(account1.balance()); // -> 0
25
26 account2.withdraw(5);
27 account2.withdraw(5);
28 account2.deposit(5);
29 account2.deposit(5);
30 account2.deposit(5);
31 account2.deposit(5);
32 console.log(account2.balance()); // -> 10