TypeScript

Bitwise Operators in Typescript

Bitwise operators convert their operands into a binary number and operate on each bit. There are several operators available Bitwise AND (&), Bitwise OR (|), Bitwise XOR (^), Bitwise NOT (~), Left Shift (<<), Sign-propagating right shift (>>) and Zero-fill right shift (>>>).

Logical Operators in Typescript

The Logical operators operate on a set of operands and return one of the operands as a return value. It is typically used on boolean operands, in which case the return value is a boolean. If the operands and not boolean values, then logical operators may return a non-boolean value. The Typescript has four logical operators. They are AND (&& ), OR ( || ) , NOT (!) & Nullish coalescing operator (??).

Comparison or Relational operators in Typescript

Comparison Operators or Relational operators compares the values of the two operand . The comparison operators are less than <, less than or equal <=, greater than >, greater than equal >=, equal (== & ===) & not equal ( != & !==). All comparison operators return true or false.

Strict Equality (==) Loose Equality (===) in Typescript

The Typescript has two operators for checking equality. One is == (equality operator or loose equality operator) and the other one is === (strict equality operator). Both of these operators check the value of operands for equality. But, the difference between == & === is that the == does a type conversion before checking for equality. Similarly, we have two, not equal operators != and !== which behaves similarly.

Arithmetic Operators in Typescript

The Typescript arithmetic operators take numerical values as their left & right operands, perform the arithmetic operation, and return a numerical value. The Typescript supports all the arithmetic operators like addition (+), subtraction (-), multiplication (*), and division (/), etc. Note that all the numbers in Typescript are represented as IEEE 754 floating-point numbers.

Scroll to Top