Mohit Panchasara has Published 87 Articles

Private, Public & Protected Access Modifiers in TypeScript

Mohit Panchasara

Mohit Panchasara

Updated on 21-Aug-2023 14:57:59

527 Views

Access modifiers are essential because they allow us to enforce encapsulation and define the boundaries of class member accessibility. With access modifiers, we can restrict access to certain members, ensuring they are only accessible within the class itself. We can also make members public, allowing them to be accessed from ... Read More

Is it possible to generate TypeScript declaration files from JS library?

Mohit Panchasara

Mohit Panchasara

Updated on 21-Aug-2023 14:54:04

493 Views

If you have ever worked with JavaScript libraries in your TypeScript projects, you may have encountered situations where you needed type information for those libraries. TypeScript declaration files, denoted with the .d.ts extension, provide type information for JavaScript code, enabling better static type checking and editor support in TypeScript projects. ... Read More

How to use Record type in typescript?

Mohit Panchasara

Mohit Panchasara

Updated on 21-Aug-2023 14:52:31

544 Views

In TypeScript, the Record type is a powerful tool that allows you to define an object type with specific keys and corresponding value types. This tutorial will guide you through the fundamentals of using the Record type, providing syntax explanations and practical examples along the way. Whether you're a beginner ... Read More

How to Get Window History in TypeScript?

Mohit Panchasara

Mohit Panchasara

Updated on 21-Aug-2023 14:51:00

1K+ Views

The user’s history of visited web pages is represented via the window.history object. A history of the pages that have been loaded is stored in an array called the history object. The history object only provides a finite amount of information. The history object only has a few properties and ... Read More

How to Fix Absolute Imports in TypeScript?

Mohit Panchasara

Mohit Panchasara

Updated on 21-Aug-2023 14:49:02

2K+ Views

Introduction When working on TypeScript projects, organizing and managing module dependencies is essential for maintaining a clean and scalable codebase. Absolute imports offer a convenient way to reference modules using a fixed path relative to the project's root directory. However, configuring and fixing absolute imports can sometimes be challenging, especially ... Read More

How to extend an interface to create a combination of interfaces?

Mohit Panchasara

Mohit Panchasara

Updated on 21-Aug-2023 14:47:19

400 Views

In TypeScript, interfaces provide a powerful way to define the shape of objects and enforce type constraints. They allow us to specify the required properties and methods that an object must have. One interesting feature of interfaces is the ability to extend them, allowing us to create a combination of ... Read More

How to draw Regular Polygon in TypeScript?

Mohit Panchasara

Mohit Panchasara

Updated on 21-Aug-2023 14:42:01

580 Views

Regular polygons, such as squares, triangles, and hexagons, are fundamental shapes used in various applications and graphics. Drawing regular polygons programmatically can be useful in TypeScript, allowing you to create geometric shapes dynamically. In this tutorial, we will explore how to draw regular polygons in TypeScript by leveraging basic mathematical ... Read More

Object - Oriented Terms Supported by TypeScript

Mohit Panchasara

Mohit Panchasara

Updated on 21-Aug-2023 14:37:42

2K+ Views

Object-oriented programming (OOP) is a popular programming paradigm that has been widely adopted in the software development industry. OOP is based on the concept of objects, which are instances of classes that encapsulate data and behaviour. TypeScript, a statically typed superset of JavaScript, is designed to support the development of ... Read More

How keyof keyword is used in TypeScript?

Mohit Panchasara

Mohit Panchasara

Updated on 21-Aug-2023 13:54:59

176 Views

In TypeScript, the keyof keyword plays a significant role when working with objects and their properties. It allows us to obtain the keys of an object and use them to perform various operations. This tutorial will guide you through the usage of keyof, providing syntax explanations and code examples for ... Read More

How is Declaration Merging done in TypeScript?

Mohit Panchasara

Mohit Panchasara

Updated on 21-Aug-2023 13:49:19

918 Views

Introduction TypeScript offers powerful features that enhance JavaScript development. One such feature is declaration merging, which allows developers to combine multiple declarations of the same entity into a single definition. This tutorial will introduce you to the concept of declaration merging in TypeScript and provide examples to help you understand ... Read More

Advertisements