The inequality operator is represented as != in JavaScript. It is used to compare whether two values are not the same, and returns true if they are different, otherwise it returns false. It is different from the strict inequality operator (!==), which also compares value types.

How to enter the inequality symbol
in JS?
In JavaScript, the inequality operator is !=.
Purpose
The inequality operator is used to compare whether two values are different. The operator returns true if the two values are not the same, and false if they are the same.
Expression syntax
<code>expression1 != expression2</code>
where expression1 and expression2 are the values to be compared.
Example
<code>console.log(1 != 2); // 输出:true
console.log("foo" != "bar"); // 输出:true
console.log(true != false); // 输出:true</code>Note
Please note that the inequality operator (!= ) is different from the strict inequality operator (!==). The strict inequality operator compares not only values, but also types.
For example:
<code>console.log("1" != 1); // 输出:true
console.log("1" !== 1); // 输出:false</code>In the first example, != returns true because the string "1" and the number 1 have different values . In the second example, !== returns false because they have the same value and type.
The above is the detailed content of How to enter the not equal symbol in js. For more information, please follow other related articles on the PHP Chinese website!