Skip to content

Commit

Permalink
rename typo
Browse files Browse the repository at this point in the history
  • Loading branch information
15Dkatz committed Feb 19, 2017
1 parent fd84251 commit 8add261
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
function collect(...a) {
console.log(a);
const budget = () => {
let balance = 0;
let changeBal = (val) => {
return balance += val;
}


const deposit20 = () => changeBal(20);
const withdraw20 = () => changeBal(-20);
const check = () => balance;

return { deposit20, withdraw20, check }
}

collect(3, 6, 9, 12, 15);
let wallet = budget();

wallet.deposit20();
wallet.withdraw20();
wallet.deposit20();
wallet.deposit20();
console.log(wallet.check());

0 comments on commit 8add261

Please sign in to comment.