From b2aab3198ff66d0d2e7a0002e192ebadb24867a2 Mon Sep 17 00:00:00 2001 From: MokwaTheDeveloper Date: Tue, 10 Oct 2023 13:51:39 +0300 Subject: [PATCH] Completed Assigment --- index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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