Lesson 1 Intro to Functions in JS


#1

Hello Everyone I am very new to the forums so please be gentle if this a very stupid question. But what seems to be the problem with my code? The error says I did not print the correct string and to check the if statement however I cannot seem to figure out the problem. I have had very little trouble up until this point. Thanks in advance!

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.")
}


#2

the string logged should be an exact match, in the instructions Slow down and Drive safe have no full stop (.), so yours shouldn't have either


#3

and missing semicolons for console as well :slight_smile:


#4

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