Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • JS Tutorial
  • JS Exercise
  • JS Interview Questions
  • JS Array
  • JS String
  • JS Object
  • JS Operator
  • JS Date
  • JS Error
  • JS Projects
  • JS Set
  • JS Map
  • JS RegExp
  • JS Math
  • JS Number
  • JS Boolean
  • JS Examples
  • JS Free JS Course
  • JS A to Z Guide
  • JS Formatter
Open In App
Next Article:
Less Than(<) Comparison Operator in JavaScript
Next article icon

Greater Than or Equal(>=) Comparison Operator in JavaScript

Last Updated : 14 Mar, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

JavaScript Greater Than or Equal Operator(>=) is used to compare two operands and return true if the left operand has a value greater than or equal to the right operand. The algorithm used in the comparison is similar to that of less than comparison the only difference is that the values are swapped and equal values are checked before returning a boolean.

Syntax:

a>=b

Example 1: In this example, we will compare String, Number, and Boolean using Greater Than or Equal Operator.

JavaScript
console.log("3">=2); console.log("2">=3); console.log(true>=false); console.log("3">="2"); console.log(3>=2); 

Output: The values are converted to the same data type and then compared. Here true is treated as one and false as 0. Therefore true is greater than false.

true  false  true  true  true

Example 2: In this example, we will use the greater than or equal operator on BigInt and other data types.

JavaScript
console.log(2n>=2); console.log(5n>=4); console.log(undefined>=null); console.log(null>=undefined) 

Output:

true  true  false  false

Supported Browsers:

  • Chrome
  • Edge
  • Firefox
  • Opera
  • Safari

We have a complete list of JavaScript Comparison Operators, to check those please go through, the JavaScript Comparison Operator article


Next Article
Less Than(<) Comparison Operator in JavaScript

S

shobhit_sharma
Improve
Article Tags :
  • JavaScript
  • Web Technologies

Similar Reads

    JS Arithmetic Operators

    • JavaScript Addition (+) Operator
      JavaScript addition (+) operator is one of the most fundamental and widely used arithmetic operators in JavaScript. It is used to perform arithmetic addition on numbers but also concatenate strings. Syntaxa + bWhere - a: The first value (number, string, or another data type).b: The second value (num
      1 min read

    • Subtraction(-) Arithmetic Operator in JavaScript
      JavaSscript arithmetic subtraction operator is used to find the difference between operators after subtracting them. Depending on the nature of the two operands, the subtraction operator performs either number subtraction or BigInt subtraction after converting both operands to numeric values. Syntax
      1 min read

    • Multiplication(*) Arithmetic Operator in JavaScript
      JavaScript arithmetic multiplication operator is used to find the product of operands. Like if we want the multiplication of any two numbers then this operator can be useful. Syntax: a*b Return: It returns the roduct of the operands. Example 1: In this example, we will perform multiplication on Numb
      1 min read

    • Division(/) Arithmetic Operator in JavaScript
      JavaScript airthmetic division operator is used to find the quotient of operands. The left operator is treated as a dividend and the right operator is treated as a divisor. Syntax: a/bReturn Type: It returns the quotient of the operands Example 1: In this example, we will perform basic division on N
      1 min read

    • Modulus(%) Arithmetic Operator in JavaScript
      The modulus (%) arithmetic operator in JavaScript returns the remainder after dividing one number by another. It is used for tasks like determining even or odd numbers, cycling through values within a range, and managing periodic events in programming. Syntax: a%bReturn Type: Remainder of the operan
      1 min read

    • Exponentiation(**) Arithmetic Operator in JavaScript
      JavaScript exponentiation(**) operator in JavaScript is represented by "**" and is used to find the power of the first operator raised to the second operator. This operator is equal to Math.pow() but makes the code simpler and can even accept BigInt primitive data type. The exponentiation operator i
      2 min read

    • Increment(+ +) Arithmetic Operator in JavaScript
      JavaScript increment(+ +) operator is used to increase the value of the variable by one. The value returned from the operand depends on whether the increment operator was on the left(prefix increment) or right(postfix increment). If the operator is used before the operand then the value is increased
      2 min read

    • Decrement(--) Arithmetic Operator in JavaScript
      JavaScript decrement operator is used to decrease the value of the variable by one. The value returned from the operand depends on whether the decrement operator was on the left(prefix decrement) or right(postfix decrement). If the operator is used before the operand then the value is decreased by o
      2 min read

    • JavaScript Arithmetic Unary Plus(+) Operator
      The Unary plus(+) operation is a single operand operator (which means it worked with only a single operand preceding or succeeding to it), which is used to convert its operand to a number, if it isn't already a number. Syntax: +Operand Below examples illustrate the Unary plus(+) Operator in JavaScri
      1 min read

    • JavaScript Arithmetic Unary Negation(-) Operator
      The Unary negation(-) operation is a single operand operator (which means it worked with only a single operand preceding or succeeding to it), which is used to convert its operand to a negative number, if it isn't already a negative number. Syntax: -Operand Example 1: This example shows the use of J
      1 min read

    JS Assignment Operators

    • Addition Assignment (+=) Operator in Javascript
      JavaScript Addition assignment operator(+=) adds a value to a variable, The Addition Assignment (+ =) Sums up left and right operand values and then assigns the result to the left operand. The two major operations that can be performed using this operator are the addition of numbers and the concaten
      2 min read

    • Subtraction Assignment( -=) Operator in Javascript
      The Subtraction Assignment Operator( -=) is used to subtract a value from a variable. This operator subtracts the value of the right operand from a variable and assigns the result to the variable, in other words, allows us to decrease the left variable from the right value. Syntax: a -= b We will no
      1 min read

    • Multiplication Assignment(*=) Operator in JavaScript
      Multiplication Assignment Operator(*=) in JavaScript is used to multiply two operands and assign the result to the right operand. Syntax: variable1 *= variable2 // variable1 = variable1 * variable2 Example 1: In this example, we multiply two numerical values using the Multiplication Assignment Opera
      1 min read

    • Division Assignment(/=) Operator in JavaScript
      JavaScript Division Assignment Operator in JavaScript is represented by "/=". This operator is used to divide the value of the variable by the value of the right operand and that result is going to be assigned to the variable. This can also be explained as dividing the value of the variable by an ex
      1 min read

    • JavaScript Remainder Assignment(%=) Operator
      JavaScript remainder assignment operator (%=) assigns the remainder to the variable after dividing a variable by the value of the right operand. Syntax: Operator: x %= y Meaning: x = x % y Below example illustrate the Remainder assignment(%=) Operator in JavaScript: Example 1: The following example
      1 min read

    • Exponentiation Assignment(**=) Operator in JavaScript
      JavaScript Exponentiation Assignment Operator in JavaScript is represented by "**=". This operator is used to raise the value of the variable to the power of the operand which is right. This can also be explained as the first variable is the power of the second operand. The exponentiation operator i
      1 min read

    • Left Shift Assignment (<<=) Operator in JavaScript
      The Left Shift Assignment Operator is represented by "<<=". This operator moves the specified number of bits to the left and assigns that result to the variable. We can fill the vacated place by 0. The left shift operator treats the integer stored in the variable to the operator's left as a 32
      2 min read

    • Right Shift Assignment(>>=) Operator in JavaScript
      The Right Shift Assignment Operator is represented by ">>=". This operator shifts the first operand to the right and assigns the result to the variable. It can also be explained as shifting the first operand to the right in a specified amount of bits which is the second operand integer and the
      1 min read

    • Bitwise AND Assignment (&=) Operator in JavaScript
      The Bitwise AND Assignment Operator is represented by "&=". This operator uses the binary representation of both operands and performs the bitwise AND operation and then assigns the result to the left operand. This can also be explained as applying the logical AND operation to the first operand
      1 min read

    • Bitwise OR Assignment (|=) Operator in JavaScript
      The Bitwise OR Assignment Operator in JavaScript is represented by (|=). This operator is used to perform a bitwise OR operation on both operands and assign the result to the left operands. Syntax: a |= b Where - a = First operandb = Second operand Example 1: In this example, we will use basic numer
      2 min read

    • Bitwise XOR Assignment (^=) Operator in JavaScript
      The Javascript Bitwise XOR assignment is represented by (^=). It is used to perform a bitwise XOR operation on both operands and assign the result to the left operand. Syntax: a ^= b // a = a ^ b Where - a = First operandb = Second operand Example: In this example, we will perform the basic Bitwise
      2 min read

    • JavaScript Logical AND assignment (&&=) Operator
      This operator is represented by x &&= y, and it is called the logical AND assignment operator. It assigns the value of y into x only if x is a truthy value. We use this operator x &&= y like this. Now break this expression into two parts, x && (x = y). If the value of x is tr
      2 min read

    • JavaScript Logical OR assignment (||=) Operator
      This operator is represented by x ||= y and it is called a logical OR assignment operator. If the value of x is falsy then the value of y will be assigned to x. When we divide it into two parts it becomes x || ( x = y ). It checks if x is true or false, if the value of x is falsy then it runs the (
      2 min read

    • Nullish Coalescing Assignment (??=) Operator in JavaScript
      This is a new operator introduced by javascript. This operator is represented by x ??= y and it is called Logical nullish assignment operator. Only if the value of x is nullish then the value of y will be assigned to x that means if the value of x is null or undefined then the value of y will be ass
      2 min read

    JS Comparison Operators

    • Equality(==) Comparison Operator in JavaScript
      In JavaScript, the Comparison Equality Operator is used to compare the values of the operand. The comparison operator returns true only if the value of two operands are equal otherwise it returns false. It is also called a loose equality check as the operator performs a type conversion when comparin
      2 min read

    • Inequality(!=) Comparison Operator in JavaScript
      JavaScript Inequality operator is used to compare two operands and returns true if both the operands are unequal it is basically the opposite of the Equality Operator. It is also called a loose inequality check as the operator performs a type conversion when comparing the elements. Also in the case
      2 min read

    • Strict Equality(===) Comparison Operator in JavaScript
      JavaScript Strict Equality Operator is used to compare two operands and return true if both the value and type of operands are the same. Since type conversion is not done, so even if the value stored in operands is the same but their type is different the operation will return false. Syntax: a===b E
      2 min read

    • Strict Inequality(!==) Comparison Operator in JavaScript
      JavaScript Strict Inequality Operator is used to compare two operators and return true if they both are unequal. It is the opposite of the Strict Equality operator but like the Strict Equality Operator, it also does not perform type conversion. Syntax: a!==b Example 1: In this example, we will use t
      1 min read

    • Greater than(>) Comparison Operator in JavaScript
      JavaScript Greater Than(>) Operator is used to compare two operands and return true if the left operand has a higher value than the right operator. Syntax: a>bExample 1: In this example, we will compare String, Number, and Boolean using Greater Than Operator. C/C++ Code console.log("3
      1 min read

    • Greater Than or Equal(>=) Comparison Operator in JavaScript
      JavaScript Greater Than or Equal Operator(>=) is used to compare two operands and return true if the left operand has a value greater than or equal to the right operand. The algorithm used in the comparison is similar to that of less than comparison the only difference is that the values are swap
      1 min read

    • Less Than(
      JavaScript Less Than(<) Operator is used to compare two operands and return true if the left operand has a lesser value than the right operator. The values are converted to equal primitive types before conversion If both the values are strings the comparison is done on the basis of their Unicode.
      1 min read

    • Less Than or Equal(
      JavaScript Less Than or Equal(<=) to the operator is used to compare two operands and return true if the left operand is smaller or equal to the right operand. The algorithm used for the comparison is the same as that of less than operator but equal condition is also checked Syntax: a<=b Examp
      1 min read

      JS Logical Operators

      • NOT(!) Logical Operator inJavaScript
        JavaScript NOT Operator can be used to find the flipped value of a boolean. It can be used to convert a true value to a false and vice-versa. This NOT operator can also be used on non-booleans to convert them to the reverse of their actual boolean value. A NOT operator can be used with another NOT o
        1 min read

      • AND(&&) Logical Operator in JavaScript
        The logical AND (&&) (logical conjunction) operator for a set of boolean operands will be true if and only if all the operands are true. Otherwise, it will be false. It's commonly used to combine conditions in conditional statements or to check multiple conditions before executing code. The
        1 min read

      • OR(||) Logical Operator in JavaScript
        The logical OR (||) (logical disjunction) operator for a set of operands is true if and only if one or more of its operands is true. It evaluates two expressions and returns true if at least one is true, otherwise, it returns false. This operator is frequently used in conditional statements to execu
        1 min read

      JS Bitwise Operators

      • AND(&) Bitwise Operator in JavaScript
        JavaScript Bitwise AND(&) operator is used to compare two operands by performing an AND operation on the individual bits and returning 1 only if both the bits are one. The AND(&) Operator has a lot of real-world applications and the most famous one is to check whether a number is even or odd
        2 min read

      • OR(|) Bitwise Operator in JavaScript
        JavaScript Bitwise OR(|) Operator is used to compare two operands by performing OR operation on individual bits of the operands and returns true even if one of the compared bits is 1. The OR Operator has vast applications and the most used one is combining bit values. The operation is represented by
        2 min read

      • XOR(^) Bitwise Operator in JavaScript
        In JavaScript, the bitwise XOR(^) Operator is used to compare two operands and return a new binary number which is 1 if both the bits in operators are different and 0 if both the bits in operands are the same. The operation is represented by the "^" symbol. This operator can be used to find the miss
        2 min read

      • NOT(~) Bitwise Operator in JavaScript
        JavaScript NOT(~) Operator is used to invert the bits of a number. The operator is represented by "~" symbol. It is a unary operator since it requires only one operand to operate. There are various uses of the Bitwise NOT operator which include bit-masking, finding two's complement as well as error
        1 min read

      • Left Shift (
        JavaScript Left Shift Operator is used to operate on the two operands. The first operand is the number and the right operand specifies the number of bits to shift to the left. The operation is represented by the "<<" symbol. Mainly the left shift operator is used to multiply the number by any
        2 min read

      • Right Shift (>>) Bitwise Operator in JavaScript
        JavaScript bitwise right shift operator is used to operate on two operands where the left operand is the number and the right operand specifies the number of bits to shift towards the right. A copy of old leftmost bits is maintained and they have added again the shifting is performed. The sign bit i
        2 min read

      • Zero Fill Right Shift (>>>) Bitwise Operator in JavaScript
        JavaScript Zero Fill Right Shift Operator or Unsigned Right Shift Operator(>>>) is used for operating on the two operands. The first operand is the number and the right operand specifies the bits to shift towards the right modulo 32. In this way, the excess bits which are shifted towards th
        2 min read

      JS Unary Operators

      • JavaScript typeof Operator
        The typeof operator in JavaScript is used to determine the data type of a value or variable. It returns a string indicating the type, such as "string", "number", "boolean", "object", etc. [GFGTABS] JavaScript console.log(typeof "Hello"); console.log(typeof 42); console.log(typeof true); co
        3 min read

      • JavaScript delete Operator
        The delete operator in JavaScript removes properties from objects, including inherited ones, and creates holes in arrays without changing their length. If a deleted property holds an object with no other references, that object is automatically released by JavaScript's garbage collector over time. S
        3 min read

      JS Relational Operators

      • JavaScript in Operator
        JavaScript in operator is an inbuilt operator which is used to check whether a particular property exists in an object or not. It returns a boolean value true if the specified property is in an object, otherwise, it returns false. Syntax:prop in objectParameters: prop: This parameter holds the strin
        2 min read

      • JavaScript Instanceof Operator
        The instanceof operator in JavaScript is used to check the type of an object at run time. It returns a boolean value if true then it indicates that the object is an instance of a particular class and if false then it is not.  Syntax:let gfg = objectName instanceof objectTypeParameters: objectName: S
        2 min read

      JS Other Operators

      • JavaScript String Operators
        JavaScript String Operators are used to manipulate and perform operations on strings. There are two operators which are used to modify strings in JavaScript. These operators help us to join one string to another string. 1. Concatenate OperatorConcatenate Operator in JavaScript combines strings using
        3 min read

      • JavaScript yield Operator
        The yield operator in JavaScript is used to hand over control of a generator function to another generator function or iterable object. It's handy for yielding values from an inner generator or iterable object within an outer generator function. This operator finds application in tasks like working
        3 min read

      • JavaScript Pipeline Operator
        The JavaScript Pipeline Operator (|>) is used for passing the result of one expression into a function. It's particularly useful for making long chains of functions easier to read. With this operator, the value before it gets sent as input to the function that follows. You simply arrange the func
        2 min read

      • JavaScript Grouping Operator
        The Grouping operator consists of a pair of parentheses around an expression or sub-expression to override the normal operator precedence so that expressions with lower precedence can be evaluated before an expression with higher priority. This operator can only contain expressions. The parameter li
        2 min read

geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences