1/13 It says this code isn't right? HELP!


#1

My code is this:

var speed = 65;

// Complete the condition in the ()s on line 4
if (speed > 80 ) {
console.log("Slow down!")
// Use console.log() to print "Slow down"

}
else (speed < 65) {
console.log("Drive safe!")
// Use console.log() to print "Drive safe"

}


#2

after ELSE you don't need to write (speed<65)

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 {
// Use console.log() to print "Drive safe"
console.log("Drive safe");

}


#3

I did this:
var speed = 65;
if (speed>80 ) {
console.log("Slow Down")
} else {
console.log("Drive Safe")
}


#4

var speed = 65;
if(speed>80){
console.log("Slow down");
}else{
console.log("Drive save");
}

check semicolon, :wink:


#5

Just get rid of (speed < 65) & add semicolons at the end on your console.log()

:smiley: Hope this is helps


#6

semicolon at the end of console.log is actually fine just the "condition" after else is not.


#7

I have same problem.
I added semicolons but wont work


#8

I did ! eu consegui e só colocar desse modo ! não sei por que os erros !!

var speed = 13.02;

if (speed < 80 ) {
console.log("Dirija com segurança");
} else {
console.log("Reduza a velocidade");
}

obs: console.log() e bom apagar e colocar novamente mais pode ir salvando!!!