Full-time web dev; JS lover since 2002; CSS fanatic. #CSSIsAwesome
I try to stay up with new web platform features. Web feature you don't understand? Tell me! I'll write an article!
He/him
IMHO, don't ever ever ever use == in JavaScript. Always use === instead and forget about type coercion; just explicitly type-cast anything you need to.
It's a very rare case when you work on a project alone. Other developers can use == and it's necessary to understand how type coercion works.
I agree that most of developers consider == as evil. But Kyle Simpson (You don't know JS author) don't hate type coercion. Moreover, he recomments to use == where necessary.
In other words, coercion, especially implicit coercion, has usages where it actually improves the readability of our code.
Type coercion is definitely not obvious in JavaScript
IMHO, don't ever ever ever use
==
in JavaScript. Always use===
instead and forget about type coercion; just explicitly type-cast anything you need to.It's a very rare case when you work on a project alone. Other developers can use == and it's necessary to understand how type coercion works.
I agree that most of developers consider == as evil. But Kyle Simpson (You don't know JS author) don't hate type coercion. Moreover, he recomments to use == where necessary.
Source.