12. functions if/else


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/2/4?curriculum_id=506324b3a7dffd00020bf661#

I'm so confused I browsed the other threads and I can't understand what I'm doing wrong.

the Syntax error is that it "expected expression, got keyword 'else"


#2


#3

else is an optional part in an if-statement.
You are terminating your if-statement on line 5 by having an empty statement as the statement that is executed when the condition is true.


#4

omg!!!!! thank you so much!


#5

Also, you should indent according to your braces, otherwise it gets very difficult to tell what belongs to what and what runs when.


#6

ok for sure I will focus on that thanks