Possible Duplicate:
Javascript === vs == : Does it matter which “equal” operator I use?
What is the difference between == and === in JavaScript? I have also seen != and !== operators. Are there more such operators?
Join Stack Overflow to learn, share knowledge, and build your career.
What is the difference between |
||||
marked as duplicate by AnthonyWJones, Jeff Atwood Feb 7 '09 at 12:04This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. |
||||
|
|
|||||||||||||||||||||
|
|
Take a look here: http://longgoldenears.blogspot.com/2007/09/triple-equals-in-javascript.html The 3 equal signs mean "equality without type coercion". Using the triple equals, the values must be equal in type as well.
|
|||||||||||||||||||||
|
==is===with type converting (aka coercion). To really understand what I mean you can look at this JavaScript function that behaves exactly like==: stackoverflow.com/a/38856418/984780 – Luis Perez Aug 9 '16 at 17:17