JSBits #4: Comparison operator
Diario del capitán, fecha estelar d71.y38/AB
Here's another JavaScript bits we wanted to share with you. Let's talk about the comparison operator, today!
Just in case you don't know it, JavaScript has two different operators to compare primitives (neither of them works with objects, though). One is == (equality) and the other is === (identity).
If you have to know only one thing is don't use == never, ever. There's always a better, safer and more performant alternative using ===.
If you want to learn more, read this StackOverflow entry.
comments powered by Disqus