

- 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
Difference between != and !== operator in JavaScript Program
'!=' comparison operator
'!=' operator checks the unequality of two objects without making the type check. It converts the datatype of two operands to one and then compares their value. For example 1 != '1' will results false.
'!==' comparison operator
'!==' operator checks the unequality of two objects with a type check. It does not converts the datatype and makes a typed check.For example 1 !== '1' will results true.
Following example, shows usage of '!=' vs '!==' operators.
Example
<!DOCTYPE html> <html> <head> <title>Operator Example</title> </head> <body> <script language="JavaScript"> console.log(" 1 != '1' " + (1 != '1')); console.log(" 1 !== '1' " + (1 !== '1')); </script> </body> </html>
Output
1 != '1' false 1 !== '1' true
- Related Questions & Answers
- Difference between == and === operator in JavaScript
- Difference between !== and ==! operator in PHP
- Difference between == and is operator in python.
- Difference between concat() and + operator in Java
- Difference between the and$ operator in php
- Difference between the Ternary operator and Null coalescing operator in php
- Difference between the | and || or operator in php
- Explain difference between == and is operator in Python.
- What is the difference between new operator and object() constructor in JavaScript?
- Difference between the AND and && operator in php
- Difference Between Copy Constructor and Assignment Operator in C++
- Difference between "new operator" and "operator new" in C++?
- Difference between Java and JavaScript.
- Difference between TypeScript and JavaScript
- Difference between JavaScript and Php
Advertisements