Define and Use an Empty Object Type in TypeScript

Define and Use an Empty Object Type in TypeScript

While building a TypeScript function, you might want to accept an object as a parameter, but you don’t care what properties it has; you want to make sure it’s some object and not a string, number, or null. For example, you are writing a logging function that accepts any object and prints it to the … Read more >>

How to Use Index Signature in TypeScript?

Index object with string in typescript

I was working on a TypeScript project that tracked the status of different cities. There, I got a challenge that the list of city names kept changing, and I didn’t know all the keys ahead of time. At first, I tried using a loose object type, but that quickly led to confusion and potential errors. … Read more >>

Unknown vs Any in TypeScript

Unknown type in TypeScript

While working on a TypeScript project, I had to deal with data coming from an external source, and I wasn’t sure what type it would be. At first, I used any type to make things easier, but it quickly caused errors that TypeScript didn’t catch. That’s when I looked into the unknown type. It seemed … Read more >>

Difference Between Namespaces and Modules in TypeScript

Namespaces and Modules in TypeScript

While building an online shopping app in TypeScript, you first use namespaces to group code like Customer, Product, and Order in one file. It works fine for small projects. However, as the app grows, you can switch to modules to split code into separate files using export and import, making it easier to manage. TypeScript, … Read more >>

Check If Object Is Undefined in TypeScript

Check if Object is Undefined Using TypeScript

You may have faced some issues where your code breaks because an object is undefined. For example, you’re trying to access a property of an object, but that object was never assigned a value. In such cases, checking if the object is undefined helps prevent runtime errors and keeps your code safe. In this tutorial, … Read more >>

Nullish Coalescing (??) vs Logical OR (||) Operator in TypeScript

TypeScript Null Coalese operator

In TypeScript, there are two operators that can be used for handling default values: the nullish coalescing operator (??) and the logical OR operator (||). While they may seem similar at first glance, they have key differences in their behavior. In this tutorial, we’ll learn about the nullish coalescing operator and the logical OR operator … Read more >>

TypeScript Record vs Object Explained with Real Examples

TypeScript Record vs Object

While working on a TypeScript project, you want to store some data, like a list of user roles and their permissions. Now you are not sure whether to use a Record or a normal Object. This can be confusing for many developers. Knowing the difference between Record and Object will help you choose the right … Read more >>

Conditionally Add Property to Object in TypeScript

Add property to dynamic form in TypeScript

When working with TypeScript applications, especially in real-world scenarios like dynamic forms or conditional configurations, there are times when you need to build objects based on user input or business logic. For example, I encountered this while developing a property management app for a client, where not every listing had a garage, pool, or parking … Read more >>

TypeScript Enums vs Types Explained with Examples

TypeScript Enums vs Types Explained with Examples

While building a TypeScript project, you may need to define a set of constant values, like user roles, status codes, or payment methods. At this point, you might wonder: Should I use an Enum or a Type alias? This is a common question for both beginners and experienced developers. TypeScript provides several ways to define … Read more >>

51 Python Programs

51 PYTHON PROGRAMS PDF FREE

Download a FREE PDF (112 Pages) Containing 51 Useful Python Programs.

pyython developer roadmap

Aspiring to be a Python developer?

Download a FREE PDF on how to become a Python developer.

Let’s be friends

Be the first to know about sales and special discounts.