Hello guys i am very new to java and i am doing a course atm. ill cut to the chase. this is my code so far:
[CODE]let getSleepHours = (day)=>{
switch(day)
case: “monday”
return “7”;
break;
case: “Tuesday”
return “6”;
break;
case: “Wednesday”
return “9”;
break;
case: “thursday”
return “8”;
break;
case: “friday”
return “5”;
break;
case: “saturday”
return “12”;
break;
case: “sunday”
return “14”;
break;
};
let getActualSleepHours = ()=>{
};
And this is where i am stuck : inside the getActualSleepHours() function, call the getSleepHours() function for each day of the week. Add them all together and return the result using the arrow function syntax and implicit return.
I tried to fugure out how to loop through the switch with a for loop but i cant really figure out how to do this with different strings (monday,thuesday etc.)
cant wait for help thank you so much in advance
~oli