I dont know what is wrong with my code


#1

Someone please check my code. I am following every rule yet i come across the red error messages
Here it is:

const getSleepHours=day=>{
 switch(getSleepHours)
     case'monday': return 6;
     break;
     case'tuesday': return 6;
     break;
     case'wednesday':return 6;
     break;
     case'thursday':return 6;
     break;
     case'friday':return 6;
     break;
     case'saturday':return 6;
     break;
     case'sunday':return 6;
     break;
}; 
//Actual Sleep Hours
const getActualSleepHours=()=>{
  return   getSleepHours('monday')+
     getSleepHours('tuesday')+
     getSleepHours('wednesday')+
     getSleepHours('thursday')+
     getSleepHours('friday')+
     getSleepHours('saturday')+
     getSleepHours('sunday');
 };
  const getIdealSleepHours=()=>{
    let idealHours= 6;
    return idealHours*7;
  };
  const calculateSleepDebt=()=>{
    let actualSleepHours=getActualSleepHours();
    let idealSleepHours-getIdealSleepHours();
  };
  let actualSleepHours=()=>{
    if(actualSleepHours===idealSleepHours){
      console.log('You got' + (actualSleepHours===idealSleepHours)' which is perfect sleep');
    }if else(getActualSleepHours > getIdealSleepHours){
      console.log('Too much sleep');
    }else{
      console.log('Not enough sleep');
    }
  };
  calculateSleepDebt();

#2

Can you post the error messages you get - otherwise it’s hard to see what the problem might be.


#3

I see one problem straight away, in your function getSleepHours you pass in a parameter called day but in your switch statement you compare the variable calledGetSleepHours (which does not exist). You should change that to day and it should be fine.