Greater Than (>) Comparison Operator Summary Returns true if the left operand is greater than the right operand. Syntax expression1 > expression2 Parameters expression1 Any legal expression. expression2 Any legal expression. Description The greater than operator compares the values of two expressions. If the expression on the left evaluates to a value that is greater than the evaluated value of the expression on the right, the greater than operator returns true; otherwise, it returns false. If either expression has a JavaScript type (such as symbols declared with var, function, or external), the greater than 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 = 2, z = 3;Console.log(x > y); // falseConsole.log(z > y); // true Comparing Values in an 'if' statement 12345678910import System; int x = 2; if (x > 1) { Console.log("x is greater than 1");}else { Console.log("x is not greater than 1");} See Also true false Greater Than or Equal To Comparison Operator Less Than Comparison Operator Less Than or Equal To Comparison Operator Share HTML | BBCode | Direct Link