Tim Mouskhelichvili • March 24, 2023 • 2 minutes to read
When creating a TypeScript project, developers often need to merge objects. But how do you do it? To merge objects in TypeScript, a developer can: Use the spread operator Use Object.assign Use the Lodash merge function This article [...]
Tim Mouskhelichvili • March 17, 2023 • 2 minutes to read
Sometimes when developing a JavaScript/TypeScript project, you might get the "type annotations can only be used in typescript files" error. But what does it mean, and how to fix it? This article explains everything about this error and shows [...]
Tim Mouskhelichvili • March 10, 2023 • 2 minutes to read
In programming, comments are a great way to add explanations to a piece of code, making it more readable and maintainable. But how do they work in TypeScript, and what is their syntax? In TypeScript, you can create two [...]
Tim Mouskhelichvili • March 6, 2023 • 2 minutes to read
TypeScript provides support for many primitive data types. One of them is the boolean type. This article explains the boolean data type in TypeScript and shows many code examples. Let's get to it 😎. Summary The definition The boolean [...]
Tim Mouskhelichvili • February 27, 2023 • 3 minutes to read
You may have seen a mysterious syntax of three dots when you open a TypeScript file in your day-to-day coding life. This syntax is called the spread operator. The spread operator allows to spread or expand iterable objects into [...]
Tim Mouskhelichvili • February 20, 2023 • 2 minutes to read
In TypeScript, sometimes a developer needs to set the optional properties from an interface as required without changing the original interface. Luckily, TypeScript offers a utility type called Required to help achieve this task. The Required utility type accepts [...]
Tim Mouskhelichvili • February 13, 2023 • 3 minutes to read
The dictionary, also called map or associative array, is one of the fundamental data structures in computer science. But what is it, and how to build one in TypeScript? In TypeScript, you can build a dictionary using: An indexed [...]
Tim Mouskhelichvili • February 6, 2023 • 2 minutes to read
TypeScript, like most other programming languages, allows developers to create variables to store different values. One of those variable types is the constant. To declare a constant in TypeScript, you can use the const keyword. Here is an example: [...]
Tim Mouskhelichvili • January 30, 2023 • 5 minutes to read
Like many other programming languages, TypeScript gives developers access to generics. But what are they, and how and when to use them? Generics make it simple to create reusable components. They allow developers to create a function, class, or [...]
Tim Mouskhelichvili • January 23, 2023 • 5 minutes to read
A class is the fundamental building block of object-oriented programming languages like C# or Java. TypeScript also provides support for classes and gives developers access to such features as inheritance, encapsulation, and polymorphism. In TypeScript, a class is an [...]