Equality (==) Comparison Operator Summary Compares two expressions for value equality. Syntax expression1 == expression2 Parameters expression1 Any legal expression. expression2 Any legal expression. Description The equality operator compares the values of two expressions. The equality operator returns true if the resulting values of the expressions are equal and false otherwise. If your code uses JavaScript code (such as symbols declared with var, function, or external), the equality 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); // trueConsole.log(y == z); // false Comparing Values in an 'if' statement 12345678910import System; int x = 1; if (x == 1) { Console.log("x is 1");}else { Console.log("x is not 1");} See Also true false Strict Equality Comparison Operator Inequality Comparison Operator Strict Inequality Comparison Operator Share HTML | BBCode | Direct Link