Please help


#1

var speed = 65;

// Complete the condition in the ()s on line 4
if (speed = > 80 ); {
// Use console.log() to print "Slow down"
console.log("Slow down");
}
else (speed <= 80) {
// Use console.log() to print "Drive safe"
console.log("Drive safe");

}


#2

I think you've put a whitespace here as well as an unnecessary semicolon:
if (speed = > 80 );

Maybe that's the problem. Go ahead and fix that :smiley:


#3

@ameliap1

@mikek is correct the semicolon is unnecessary

and also

I think you accidentally put // Use console.log() to print "Slow down" and // Use console.log() to print "Drive safe" inside the curly braces {}, try removing it or moving it somewhere else. Hope I helped.

Fixed code

var speed = 65;

// Complete the condition in the ()s on line 4
if (speed = > 80 ) {
console.log("Slow down");
}
else (speed <= 80) {
console.log("Drive safe");
}


#4

@fabian_se Lines that start with // are comments so the interpreter doesn't read them anyway. But @ameliap1 also have a look at your else case. Else is the default case if nothing before matched so it doesn't require a condition and is confused if there is one.