+ 1
Else If ends with Else JavaScript
Does an else of have to end with else or can it just end with the brackets?
4 Antworten
+ 3
As far as i know it doesnt make a difference (your code is still valid) but if you for example check if something is null (object) it's better to throw an error. That's why the JS course suggested else statements.
+ 3
Can you please specifiy your language and your problem +code a little bit deeper so we can give you a detailed answer.
+ 3
Generally speaken: in most (all i know) languages an IF statement can end only with brackets not eith an additional else statement
+ 1
thanks, thats what i thought too but the javascript tutorial suggested otherwise. thank yiu for the help.