Functions & if / else,


#1


https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/2/4?curriculum_id=506324b3a7dffd00020bf661#


What's wrong with my code?


// Write your function below. 
// Don't forget to call your function!
var sleepCheck = funtion(numHours){
    if(numHours >= 8){
        return "You're getting plenty of sleep! Maybe even too much!";
    }
    else {
        return "You're getting plenty of sleep! Maybe even too much!";
    }
    
 };
console.log(sleepCheck(10));
console.log(sleepCheck(5));
console.log(sleepCheck(8));


#2

here:

var sleepCheck = funtion(numHours){

you misspelled function, so JS doesn't recognize you want to use a function

also, the string returned should be an exact match, copy paste it from the instructions


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.