Skip to content

Conversation

@JungMinu
Copy link

@JungMinu JungMinu commented Sep 2, 2015

There is no type-conversion to be done because both parameters are already the same type.
Therefore, the === operator should be used for better performance.

There is no type-conversion to be done because both parameters are already the same type. 
Therefore, the === operator should be used for better performance.
@JungMinu
Copy link
Author

JungMinu commented Sep 2, 2015

Please refer to the following review
https://dorey.github.io/JavaScript-Equality-Table/

@mathiasbynens
Copy link
Owner

I seriously doubt == vs. === is ever going to be a performance bottleneck. Do you have a benchmark that demonstrates the improved performance you mentioned?

@JungMinu
Copy link
Author

JungMinu commented Sep 4, 2015

@mathiasbynens Do you prefer == to === in general?

@mathiasbynens
Copy link
Owner

@JungMinu Yeah, in all my code I’ve only been using === when I explicitly need strict equality.

@JungMinu
Copy link
Author

JungMinu commented Sep 4, 2015

@mathiasbynens Don't you think that there are some side-effects when using == in general?

https://dorey.github.io/JavaScript-Equality-Table/

Can I ask you please tell me why you prefer ==?

@mathiasbynens
Copy link
Owner

@JungMinu I agree, but in my own code I know which types to expect, so none of those side effects apply here.

@JungMinu
Copy link
Author

JungMinu commented Sep 4, 2015

@mathiasbynens Well, is there any benefit when using == rather than === whenever possible?
I'm not arguing, but I just want to know the reason :)

@sindresorhus
Copy link

Using === does make the code clearer and more consistent though.

@mathiasbynens mathiasbynens force-pushed the master branch 2 times, most recently from 75532e6 to 952c3ea Compare March 20, 2016 01:24
@mathiasbynens
Copy link
Owner

No longer applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants