DEV Community

Discussion on: There's no "else if" in JS

Collapse
 
twigman08 profile image
Chad Smith

Yes, as far as I know this is how a lot of languages, at least most "C-Style language" will do this. You can also look at the grammar of a lot of languages and figure out from there that it would have to do that as else if is not being defined as one keyword. They are separate keywords.

The same is also in python with elif, which j believe is actually just syntatic sugar in the end, and would end up producing the same code.