DEV Community

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

Collapse
 
genta profile image
Fabio Russo • Edited

Hm, It seems that you've not read all the post.
At some point I wrote:

I'm not writing this post, just because It's something really curious to know.
I'm writing this to make you think about all the good parts or right ways to code, that forces you to write code in a way, that sometimes It's not really the best way.

It's just a:
see? You're using this, but you dunno how It works. Why are you using It? Because someone told you to do so? Or what?

Collapse
 
kepta profile image
Kushan Joshi • Edited

But you can continue digging how it works till you reach the bits of a processor.

I get it you can write ‘if’ ‘else if’ ‘else’ with just ‘if’ ‘else’. And from reading your post it seems the browser might be internally doing it.
But what is the actual value in this revelation.
By no means I am trying disrespect this post, just trying to understand the point.

For the sake of argument one can even write everything with Bitwise OR, AND operator, but we don’t see people writing about it.

Thread Thread
 
genta profile image
Fabio Russo

I'm NOT explaining HOW it works :D
I'm trying to discuss about, all the time we code by rules without knowing the why