diff --git a/src/makeRobotAccountant.js b/src/makeRobotAccountant.js index 38b9758a..f101134c 100644 --- a/src/makeRobotAccountant.js +++ b/src/makeRobotAccountant.js @@ -6,7 +6,19 @@ */ function makeRobotAccountant() { - // write code here + let count = 0; + + return function(a) { + return function(b) { + count++; + + if (count > 3 && count % 2 === 0) { + return 'Bzzz... Error!'; + } + + return a + b; + }; + }; } module.exports = makeRobotAccountant;