Inequality (!=) Comparison Operator Summary Compares two expressions for value inequality. Syntax expression1 != expression2 Parameters expression1 Any legal expression. expression2 Any legal expression. Description The inequality operator compares the values of two expressions. The inequality operator returns true if the resulting values of the expressions are not equal and false otherwise. If your code uses JavaScript code (such as symbols declared with var, function, or external), the inequality operator will additionally - at runtime - convert the values of the expressions to the same type before comparing the values of the results. Examples Comparing Values 12345import System; int x = 1, y = 1, z = 2;Console.log(x != y); // falseConsole.log(y != z); // true Comparing Values in an 'if' statement 12345678910import System; int x = 1; if (x != 1) { Console.log("x is not 1");}else { Console.log("x is 1");} See Also true false Equality Comparison Operator Strict Equality Comparison Operator Strict Inequality Comparison Operator Share HTML | BBCode | Direct Link