Where is the mistake?


please help me.

Where is a mistake (unespected token else)
/ Vous ne savez pas par où commencer ? Regardez l'indice !
console.log( "J'ai fini mon premier cours !" );


17/28 JavaScript french

Hello, @andisor!
I'm not a Java programmer but the syntax of it reminds me a bit of C++.
Whenever we have an else statement, we consider that all the possible conditions have been tested and the last one, sometimes the error, is executed in the body of the else statement so in this case there's no more comparision of values.
The values that willl be tested, which are inside the if statement shouldn't be a string, otherwise it won't be able to check if the condition is True or False, so you might want to change that.

If there's more than one possible condition, lenght equal to 4, 5, 6, or even more, and each condition has a different message to be printed, use if's. (plural for if)
Check the following link for more info about it: If - Else.

Hope that helps you!


Thank you for your advice.Regards


No problem, Andisor! Glad to help!


Though your question is regarding javascript, refer this resource with some beautiful explanation for logic.