diff --git a/index.js b/index.js index e303d299..f4fc45ad 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,15 @@ /* Your Code Here */ +const allWagesFor = function () { + const eligibleDates = this.timeInEvents.map(function (e) { + return e.date; + }); + + const payable = eligibleDates.reduce(function (memo, d) { + return memo + wagesEarnedOnDate.call(this, d); + }.bind(this), 0); + + return payable; +} /* We're giving you this function. Take a look at it, you might see some usage