
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Which equals operator (== vs ===) should be used in JavaScript?
Double equals (==) is abstract equality comparison operator, which transforms the operands to the same type before making the comparison.
For example,
5 == 5 //true '5' == 5 //true 5 == '5' //true 0 == false //true
Triple equals (===) are strict equality comparison operator, which returns false for different types and different content.
For example,
5 === 5 // true 5 === '5' // false var v1 = {'value':'key'}; var v2 = {'value': 'key'}; v1 === v2 //false
- Related Questions & Answers
- Which equals operator (== vs ===) should be used in JavaScript comparisons
- Which MySQL Datatype should be used for storing BloodType?
- Among id, name, xpath and css, which locator should be used?
- Which Measurement Unit should be used in CSS to set letter spacing
- When to use new operator in C++ and when it should not be used?
- equals() vs == in Java
- MySQL isn’t inserting binary data properly? Which datatype should be used?
- Which function should be used to load a package in R, require or library?
- Explain the scenario in which CURSOR should be used over a standalone SELECT statement?
- How should strace be used on Linux?
- What are the different wildcard characters which can be used with NOT LIKE operator?
- When should static_cast, dynamic_cast, const_cast and reinterpret_cast be used?
- PHP string cast vs strval function, which one should I use?
- Difference between equals() vs equalsIgnoreCase() in Java
- What HTML5 tag should be used for filtering search results.
Advertisements