Understanding the Question Mark (?:) in TypeScript
The question mark (?:) in TypeScript is used to define a property or parameter as optional. This article shows examples to understand this concept and more.
The question mark (?:) in TypeScript is used to define a property or parameter as optional. This article shows examples to understand this concept and more.
You can use optional parameters in TypeScript by adding a question mark ? at the end of each parameters to avoid passing all parameters defined in a function.
Have you been using TypeScript for a while but you are not sure how the compilation works? In this article, we are going to go in deep about this works, what does it mean to compile a code as well as understanding why TypeScript needs to be compiled. How humans communicate with computers? As programmers, … Read more
New types came with the release of TypeScript 3.0. One of them is the unknown type which we will cover in this complete guide with easy examples to follow.
Are you are new to TypeScript and want to start working on your first project? Some of the questions many developers ask are: How do you structure your types in a TypeScript project? What is the best way to structure your typings that is robust and expandable? Where to put interfaces and type aliases? and … Read more
The double question marks (??) are also called nullish coalescing operators in TypeScript. They allow to use of a default value set on the right side of the operator in case the initial value from the left side of the operator is null or undefined.
Learn how to define object types with unknown keys and known values using TypeScript by explaining with easy code examples.
Learn different ways to declare an empty object for a typed variable using TypeScript by presenting easy to follow examples
Use Union types allows you to define a variable as a string, or a number, or an array, or an object, etc. in TypeScript, which helps you define multiple types.
Learn how to use enums in TypeScript, which are a special type not found in regular JavaScript allowing us to define constants.