Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
JavaScript: Use === Instead of ==
(
codingstyleguide.com
)
2 points
by
diegoloop
on April 28, 2014
|
hide
|
past
|
favorite
|
4 comments
bdfh42
on April 28, 2014
|
next
[–]
The whole point of having two sets of comparitors (=== and == in this instance) is that you can use the correct one for any given circumstance. Proscribing the use of one in favour of the other is just woolly thinking.
diegoloop
on April 28, 2014
|
parent
|
next
[–]
Yes but in most of the cases it's better to use === operators. I mean, they both are correct. It's just a matter of style
avelis
on April 28, 2014
|
prev
[–]
This is almost always the case to help avoid type coercion where one does not want it.
diegoloop
on April 28, 2014
|
parent
[–]
Agreed, here are more JS styles that might be interesting for you:
http://codingstyleguide.com/lang/6/javascript
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: