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.
Name | Description | Syntax |
---|---|---|
Ternary/Conditional Operator | Evaluates the condition. If true, returns expression_if_true ; if false, returns expression_if_false . |
condition ? expression_if_true : expression_if_false; |
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