TypeScript Relational operators

In TypeScript, relational operators are used to compare two values and determine the relationship between them.

Name

Description

Syntax

Equal to (==)

Returns true if the values of the two operands are equal, after type coercion.

result = operand1 == operand2;

Not equal to (!=)

Returns true if the values of the two operands are not equal, after type coercion.

result = operand1 != operand2;

Strictly equal to (===)

Returns true if the values of the two operands are equal, without type coercion (strict equality).

result = operand1 === operand2;

Strictly not equal to (!==)

Returns true if the values of the two operands are not equal, without type coercion (strict inequality).

result = operand1 !== operand2;

Greater than (>)

Returns true if the value of the left operand is greater than the value of the right operand.

result = operand1 > operand2;

Less than (<)

Returns true if the value of the left operand is less than the value of the right operand.

result = operand1 < operand2;

Greater than or equal to (>=)

Returns true if the value of the left operand is greater than or equal to the value of the right operand.

result = operand1 >= operand2;

Less than or equal to (<=)

Returns true if the value of the left operand is less than or equal to the value of the right operand

result = operand1 <= operand2;

TypeScript Operators

TypeScript operators are symbols or keywords that perform operations on one or more operands. In this article, we are going to learn various types of TypeScript Operators.

Below are the different TypeScript Operators:

Table of Content

  • TypeScript Arithmetic operators
  • TypeScript Logical operators
  • TypeScript Relational operators
  • TypeScript Bitwise operators
  • TypeScript Assignment operators
  • TypeScript Ternary/conditional operator
  • TypeScript Type Operators
  • TypeScript String Operators

Similar Reads

TypeScript Arithmetic operators

In TypeScript, arithmetic operators are used to perform mathematical calculations....

TypeScript Logical operators

In TypeScript, logical operators are used to perform logical operations on Boolean values....

TypeScript Relational operators

In TypeScript, relational operators are used to compare two values and determine the relationship between them....

TypeScript Bitwise operators

In TypeScript, bitwise operators perform operations on the binary representation of numeric values....

TypeScript Assignment operators

In TypeScript, assignment operators are used to assign values to variables and modify their values based on arithmetic or bitwise operations....

TypeScript Ternary/conditional operator

In TypeScript, the ternary operator, also known as the conditional operator, is a concise way to write conditional statements. It allows you to express a simple if-else statement in a single line....

TypeScript Type Operators

In TypeScript, type operators are constructs that allow you to perform operations on types. These operators provide powerful mechanisms for defining and manipulating types in a flexible and expressive manner....

TypeScript String Operators

In TypeScript, string operators and features are used for manipulating and working with string values....

Contact Us