How to Check and Print the Type of an Object in TypeScript

Check and Print the Type of an Object in TypeScript

While building a TypeScript project, you receive an object from an API or a function. You want to check the type of object during development to debug or better understand your code. Since TypeScript types are not available at runtime, you need a way to print helpful type-related information using typeof, instanceof, or by logging … Read more >>

Use of Any Type in TypeScript

Use Any keyword in TypeScript for assertion

While reviewing the code of a TypeScript project, I noticed a variable using the ‘any’ type. It was referred in many places to avoid type errors. Some developers think that it is the easiest way to make the code work. But later, using any keyword too much can hide problems and remove the benefits of … Read more >>

Difference Between TypeScript .ts and .tsx Files

TypeScript .ts and .tsx Files

TypeScript is popular among developers who want to add type safety to their JavaScript code. When you start using TypeScript, you will see two types of files: .ts and .tsx. It is essential to understand the differences between them, particularly when using TypeScript with React. This tutorial explains the difference between TypeScript .ts and .tsx … Read more >>

TypeScript As Keyword

As keyword in TypeScript

I was working on a TypeScript project that required handling data from a third-party API. TypeScript doesn’t always know the exact type of a variable, especially when dealing with external APIs or complex data structures. Without defining the data, I was getting errors because we need a way to tell TypeScript about the type we … Read more >>

Understanding TypeScript Record: The Ultimate Guide

Creating Objects with String Literal Keys in TypeScript

Recently, I was working on a TypeScript project that required creating a flexible way to store key-value pairs with type safety. The issue is… many developers struggle with properly typing objects in TypeScript. In this article, I’ll cover everything you need to know about the TypeScript Record utility type, with practical examples that will make … Read more >>

How to Call REST APIs Using TypeScript?

API calling in TypeScript

Recently, while building a frontend project with TypeScript, I had to use a REST API to fetch user data and submit form inputs. Initially, I began with the basic Fetch API, but as the project evolved, I needed something more effective, particularly for handling errors and implementing reusable logic. Then I used REST APIs to … Read more >>

Understanding and Using TypeScript Decorators [Practical Examples]

Understanding and Using TypeScript Decorators

While working on a TypeScript project, I needed to add extra information (metadata) to classes and their properties, such as logging when a method runs or validating input, without modifying their actual implementation. That’s when I discovered TypeScript decorators. Decorators allow you to add metadata, modify, or extend the behavior of classes, methods, and properties … Read more >>

TypeScript Promises: A Comprehensive Guide

Create Promise Utility in TypeScript

As a TypeScript developer with years of experience, I’ve found that promises are one of the most powerful features when dealing with asynchronous operations. Whether you’re fetching data from an API, reading files, or executing time-consuming tasks, promises help you manage the flow of your application. Recently, I was working on a TypeScript project where … Read more >>

How to Use Non-Null Assertion (!) in TypeScript

TypeScript with null check assertion

I was working on a TypeScript project, and I often encountered values that could be null or undefined. I had to repeatedly check for null, which made my code lengthy and difficult to read. Then I discovered TypeScript’s non-null assertion operator (denoted by an exclamation mark). This small symbol helped me write cleaner code while … Read more >>

How to Use Typescript Omit with Multiple Properties?

Omit with String Literal Types in TypeScript

Recently, I was building a TypeScript-based healthcare application where I needed to create different views of the same user data like some for public display, some for internal medical staff, and others for account settings. The issue was that each view required removing a different set of sensitive or internal-use-only properties from a complex interface. … 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.