Category: Math
Tests whether a value is greater than or equal to another value.
Your apps will sometimes need to check the relative size of two values, and then possibly perform some specific action using an if, if-else, or while block. < returns true if the value on the left-hand side of the opertor is greater than or equal to the value on the right-hand side of the operator.
// Basic numeric greater than or equal to check. var x = 5; var y = 4; console.log(x >= 5); console.log(x >= 6); console.log(x >= y);
Example: Comparing "apples" the "Apples" Basic string greater than or equal to check. Case matters for string comparison.
// Basic string greater than or equal to check. Case matters for string comparison. var x = "apples"; var y = "Apples"; console.log(x >= "apples"); console.log(x >= "bananas"); console.log(x >= y);
___ >= ___
Name | Type | Required? | Description |
---|---|---|---|
___ | any | Yes | The operands can be a number/string/boolean, or a variable containing a number/string/boolean, or the number/string/boolean returned by a function, or the number/string/boolean result of the evaluation of an expression. |
Boolean true or false
Found a bug in the documentation? Let us know at documentation@code.org
__ >= __
Boolean (true or false)
Found a bug in the documentation? Let us know at documentation@code.org