TypeScript Assignment operators
In TypeScript, assignment operators are used to assign values to variables and modify their values based on arithmetic or bitwise operations.
Name | Description | Syntax |
---|---|---|
Assignment (= ) |
Assigns the value of the right operand to the left operand. | variable = value; |
Addition Assignment (+= ) |
Adds the value of the right operand to the current value of the left operand and assigns the result to the left operand. | variable += value; |
Subtraction Assignment (-= ) |
Subtracts the value of the right operand from the current value of the left operand and assigns the result to the left operand. | variable -= value; |
Multiplication Assignment (*= ) |
Multiplies the current value of the left operand by the value of the right operand and assigns the result to the left operand. | variable *= value; |
Division Assignment (/= ) |
Divides the current value of the left operand by the value of the right operand and assigns the result to the left operand. | variable /= value; |
Modulus Assignment (%= ) |
Calculates the remainder when dividing the current value of the left operand by the value of the right operand and assigns the result to the left operand. | variable %= value; |
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
Contact Us