28. Conclusion: Part 2


#1



https://www.codecademy.com/courses/getting-started-v2/4/5?curriculum_id=506324b3a7dffd00020bf661#


Oops, try again. There was a problem with your syntax.
SyntaxError: Unexpected token else


if (7 === 3)
{
    console.log("I'm sorry. You got an F- on this course.")
}
{
else (8 > 2)
}
{
    console.log("I finished my first course!")
}


#2

@technut123,
You should know that a pair of semi-colon-{ }
are used to encapsulate a =code-block=

An IF ELSE statement structure
should look like

if ( condition ) {
   //this is a line-comment
   //this is also the IF code-block
}
else {
  //as you can see the ELSE does not take a =condition=
}

Reference

google search
== the Book ==
javascript [your question] site:developer.mozilla.org

== discussions / opinions ==
javascript [your question] site:stackoverflow.com

== guidance ==
www.crockford.com
http://javascript.crockford.com/code.html <---JavaScript code-convention
http://javascript.crockford.com/survey.html
https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript
www.developer.mozilla.org/en-US/docs/Web/JavaScript/Guide


#3

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