11'use strict' ;
22
3- const monday = [
4- {
5- name : 'Write a summary HTML/CSS' ,
6- duration : 180
7- } ,
8- {
9- name : 'Some web development' ,
10- duration : 120
11- } ,
12- {
13- name : 'Fix homework for class10' ,
14- duration : 20
15- } ,
16- {
17- name : 'Talk to a lot of people' ,
18- duration : 200
19- }
3+ const monday = [ {
4+ name : 'Write a summary HTML/CSS' ,
5+ duration : 180
6+ } ,
7+ {
8+ name : 'Some web development' ,
9+ duration : 120
10+ } ,
11+ {
12+ name : 'Fix homework for class10' ,
13+ duration : 20
14+ } ,
15+ {
16+ name : 'Talk to a lot of people' ,
17+ duration : 200
18+ }
2019] ;
2120
22- const tuesday = [
23- {
24- name : 'Keep writing summary' ,
25- duration : 240
26- } ,
27- {
28- name : 'Some more web development' ,
29- duration : 180
30- } ,
31- {
32- name : 'Staring out the window' ,
33- duration : 10
34- } ,
35- {
36- name : 'Talk to a lot of people' ,
37- duration : 200
38- } ,
39- {
40- name : 'Look at application assignments new students' ,
41- duration : 40
42- }
21+ const tuesday = [ {
22+ name : 'Keep writing summary' ,
23+ duration : 240
24+ } ,
25+ {
26+ name : 'Some more web development' ,
27+ duration : 180
28+ } ,
29+ {
30+ name : 'Staring out the window' ,
31+ duration : 10
32+ } ,
33+ {
34+ name : 'Talk to a lot of people' ,
35+ duration : 200
36+ } ,
37+ {
38+ name : 'Look at application assignments new students' ,
39+ duration : 40
40+ }
4341] ;
4442
45- const tasks = monday . concat ( tuesday ) ;
43+ const tasks = monday . concat ( tuesday )
44+ let minutesToHours = tasks . filter ( a => a . duration >= 120 ) . map ( h => h . duration / 60 ) ;
4645
47- // Add your code here
46+ console . log ( minutesToHours ) ;
47+
48+ let perHour = minutesToHours . map ( v => v * 23 ) // per hour 23 euro
49+
50+ console . log ( perHour ) ;
51+
52+ let total = perHour . reduce ( function ( a , b ) {
53+ return a + b ;
54+
55+ } ) ;
56+ total = total . toFixed ( 2 ) ; //rounding number
57+ console . log ( "Maartje totally will earn: " + total + " Euro" ) ;
0 commit comments