FAQ: Conditional Statements - Logical Operators

If    versus    if

let mood = ‘sleepy’;
let tirednessLevel = 6;
if (mood === ‘sleepy’ && tirednessLevel > 8) {
console.log(‘time to sleep’);
} else {
console.log(not bed time yet);
}

Where is my error?! Stumped.

To preserve code formatting in forum posts, see: How do I format code in my posts?

Is the following just a copy/paste issue or did you forget the quotes for the string?

// You wrote:
console.log(not bed time yet);

// It should be:
console.log('not bed time yet');