Skip to content

Commit

Permalink
Update starter code to use const
Browse files Browse the repository at this point in the history
  • Loading branch information
lizbur10 committed Jun 30, 2021
1 parent 5d61e25 commit 432e30d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
for you to use if you need it!
*/

let allWagesFor = function () {
let eligibleDates = this.timeInEvents.map(function (e) {
const allWagesFor = function () {
const eligibleDates = this.timeInEvents.map(function (e) {
return e.date
})

let payable = eligibleDates.reduce(function (memo, d) {
const payable = eligibleDates.reduce(function (memo, d) {
return memo + wagesEarnedOnDate.call(this, d)
}.bind(this), 0) // <== Hm, why did we need to add bind() there? We'll discuss soon!

return payable
}
}

0 comments on commit 432e30d

Please sign in to comment.