Skip to content
Prev Previous commit
Next Next commit
ex2 is added
  • Loading branch information
amirhshad committed Nov 23, 2020
commit 433e60e8faa69f551c44a8365b144d68e1b83311
10 changes: 8 additions & 2 deletions Week2/js-exercises/ex2-whatsYourMondayWorth.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@

function dayWorth(tasks, hourlyRate) {
// put your code in here, the function does returns a euro formatted string
const TDur = mondayTasks.map(duration);
console.log(TDur)
const totalTime = tasks
.map(item => item.duration)
.map(item => item/60)
.map(item => item * hourlyRate)
.reduce((a,b) => a + b,0)
return totalTime;


}

const mondayTasks = [{
Expand Down