Ready to supercharge your Node.js development? Nodemon’s got your back! In this tutorial, we’ll show you how to set up Nodemon to automatically restart your Node.js app when you make changes to your TypeScript code. Get ready for a faster, smoother development experience.Continue reading →Best Practices
The error message that undefined cannot be assigned to a specific type often occurs when working with optional parameters. When a parameter is marked as optional, it can either be
undefined or of the specified type. In TypeScript this is represented by a union type such as
undefined | string. If you want to use a function that doesn’t accept
undefined as a parameter (e.g.,
parseInt), you must first validate that your value exists.
Here are some helpful tricks for accomplishing this.Continue reading →New Features
GitHub workflows provide an excellent platform for setting up a continuous integration pipeline. Within a workflow, you can define one or more jobs. GitHub provides virtual machines, referred to as runners, for executing jobs in a GitHub Actions workflow. These runners can be hosted either on GitHub’s infrastructure (GitHub-hosted runners) or your own infrastructure (self-hosted runners).
In this tutorial, you will learn how to use a matrix strategy to run jobs concurrently using different runner images. This approach enables you to test your TypeScript code across different operating systems or configurations, such as different versions of Node.js.Continue reading →Hands-On
In this TypeScript tutorial, we explore the concepts of type annotations and type inference. We clarify the distinction between the two and discuss their significance in writing maintainable and robust code.Continue reading →New Features
TypeScript uses a structural type system, which means that type compatibility is based on the shape or structure of the types rather than their explicit declarations or names. This allows you to define two types with different names but identical properties, enabling interchangeability between them.Continue reading →New Features
The introduction of the satisfies operator in TypeScript 4.9 enables us to verify that the type of an expression corresponds to a specific type. It can offer greater precision compared to a type annotation and assist in narrowing down a union type.Continue reading →New Features
When downleveling is applied, TypeScript’s compiler (Continue reading →Best Practices
The noUncheckedIndexedAccess compiler option is designed to help catch potential errors caused by accessing arrays or tuples with possibly Continue reading →New Features
undefined or out-of-bounds indices. When this option is enabled, TypeScript assumes that indexed accesses can result in undefined values and requires developers to handle such cases explicitly.
undefined. Although it may not initially seem particularly useful, the void operator plays a significant role in preventing unintended leakage of return values and handling Promises for side effects.