! = and! == What is the difference in JavaScript?

JavaScript includes operators like in other languages. An operator performs some operations on one or more operands (data values) and produces a result.

Table of Contents

 For example 1 + 2 , where + is the operator and 1 is the left operand and 2 is the right operand. The + operator adds two numeric values ​​and produces a result of 3 in this case.

Today's article will help readers learn about 2 ! = And ! == operators in JavaScript.

Operator! =

The inequality ( ! = ) Operator is the opposite of the equality ( == ) operator. It means 'Not Equal' and returns True , when equality returns False and vice versa.

Like the == operator, the ! = Operator will convert data types of values ​​while comparing.

Example 1! = '1' will return False because the data type conversion took place and 1 and '1' are considered equal.

Operator! ==

The strict inequality ( ! == ) operator is the opposite of the strict equality operator ( === ). It means 'Strictly Not Equal' and returns True when strict equality returns False and vice versa.

Like the === operator, the ! == operator will not convert data types.

Example 1! == '1' will return True because 1 is an integer and '1' is a character and no data type conversion takes place.

Illustration:

 

Output:

Picture 1 of ! = and! == What is the difference in JavaScript?Example output

You've just finished reading the article "! = and! == What is the difference in JavaScript?" edited by the TipsMake team. You can save -and-what-is-the-difference-in-javascript.pdf to your computer here to read later or print it out. We hope this article has provided you with many useful tech tips and tricks. You can search for similar articles on tips and guides. Thank you for reading and for following us regularly.

« PREV Review Tenda Nova MW6 and MW3: Good, cheap mesh mesh WiFi system from China
NEXT » What is the Master Partition Table?