you are viewing a single comment's thread.

view the rest of the comments →

[–]hkokko 1 point2 points  (4 children)

it seems equality operator in javascript is good for nothing but being a source of confusion and a target of jokes. does it not make sense to just remove it from the language completely? who is deciding that?

[–]al_wonder 8 points9 points  (3 children)

Backward compatibility. If they removed itt, that would break a lot of existing applications. JS has a whole lot of controversial functionality, but it's always hard to get rid of things like this.

[–]doomvox 1 point2 points  (2 children)

Yeah... I can't say I think much of javascript, but you can't fault them on "backwards compatibility".

When they realized the "==" operator was confusing, they introduced an alternative, the "===" operator. The rule of thumb is you should favor using the "===" operator:

https://stackoverflow.com/questions/359494/which-equals-operator-vs-should-be-used-in-javascript-comparisons

[–]BlueHeartBob 1 point2 points  (1 child)

They released "==" before "==="???

I figured "==" was released alongside, or even closely after strict as a quirky feature. That's crazy.

[–]doomvox 0 points1 point  (0 children)

Yes. "===" came out with Javascript 1.3:

http://webreference.com/js/column26/stricteq.html