#9 global vs local please help


#1



I am getting the error code: console.log is not a function. I am not sure what that means. please help

var my_number = 7; //this has global scope

var timesTwo = function(number) {
    var keyWord = number * 2;
    console.log("Inside the function my_number is: ");
    console.log(keyWord);
}; 

timesTwo(7);

console.log("Outside the function my_number is: ")
console.log(my_number);


#2

@gallo216

This line must be redeclaring my_number variable to set it equal to the sum of number times 2. This way we can compare what is a global and local variable.

This line must be logging my_number value.


#3

gotcha.

what do u find wrong with this?
ar sleepCheck=function (numHours){
if (numHours>=8) {
return ""You're getting plenty of sleep! Maybe even too much!";
}
else {
return "Get some more shut eye!";
}
}

console.log(sleepCheck(10))
console.log(sleepCheck(5))
console.log(sleepCheck(8))


#4

var sleepCheck=function (numHours){
if (numHours>=8) {
return ""You're getting plenty of sleep! Maybe even too much!";
}
else {
return "Get some more shut eye!";
}
}

console.log(sleepCheck(10))
console.log(sleepCheck(5))
console.log(sleepCheck(8))


#5

Never mind, I got it. there is so much to look out for and when debugging, there is a lot to consider