Check If a Key Exists in a TypeScript Object

Check If a Key Exists in a TypeScript Object

While working on a TypeScript project, you receive data from an API as an object. Before using any property from that object, you want to make sure the key actually exists to avoid errors. For example, you want to display the user’s email, but you’re not sure if the email key is present in the … Read more >>

Sort Arrays by Date in TypeScript

Sort Array Dates in Descending Order in TypeScript

When I was working on a TypeScript project recently, I had to display a list of events sorted by their dates. I used .sort() to arrange them, but it didn’t work as expected because the dates were a mix of strings and Date objects. To fix this, I converted all the date values to Date … Read more >>

Convert a TypeScript Enum to an Array

Convert Enum into Array in TypeScript

When working with enums in TypeScript, you may encounter situations where you need to convert an enum to an array. This can be useful when creating a select box or iterating over the enum values. In this tutorial, we will learn how to convert a TypeScript enum to an array. I will explain different methods, … Read more >>

Add Seconds to Date in TypeScript

Adding Seconds to a Date in Typescript

When we work with dates and times in TypeScript, even a small adjustment, like adding a few seconds, can avoid plenty of code corrections later. In this Typescript tutorial, we will start with a simple Date object and show you how to push it forward by the exact number of seconds you need. Whether you are … Read more >>

TypeScript Class vs Interface Explained with Examples

TypeScript Class vs Interface Explained with Examples

TypeScript, a superset of JavaScript, enhances the language with static types, making it a powerful tool for building large-scale applications. Two fundamental concepts in TypeScript are classes and interfaces. Understanding when and how to use them is crucial for writing clean, maintainable code. In this tutorial, we will understand the TypeScript class vs interface, explain … Read more >>

How to Convert Dates to UTC in TypeScript?

Date to UTC conversion in TypeScript

I was recently working on a feature that needed to sync date and time data across users in different time zones. There, I noticed that times were showing up inconsistently depending on where the user was located. In that situation, I had to convert all dates to UTC (Coordinated Universal Time) to keep the date … Read more >>

Create Custom Types from Enum Values in TypeScript

Create Custom Types from Enum Values in TypeScript

As a developer working on a project for a US-based company, I recently faced a challenge where I needed to define a set of related constants and use them to create custom types. TypeScript enums proved to be the perfect solution, allowing me to write more readable, maintainable, and type-safe code. In this tutorial, I … Read more >>

Format Dates in TypeScript as YYYY-MM-DD

Formatted date in TypeScript using YYYY-MM-DD format

When working with dates in TypeScript, formatting them into a readable or standardized structure is often necessary, especially for storing in databases or displaying in user interfaces. One of the most common formats used in web development is YYYY-MM-DD, which ensures consistency across systems and locales. In this tutorial, you’ll learn to format dates in … Read more >>

Check Enum Equality in TypeScript

Check Enum Equality in TypeScript

Recently, while working on a project for a client, I faced a bug because I used the wrong comparison operator. I was comparing two enum values using ==, thinking it would work. But the values didn’t match because one was a number and the other was a string. When I changed the operator to ===, … 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.