TypeScript

Type-safe JavaScript with TypeScript

187 tutorials
12 of 187 tutorials
Jul 17, 2026· 6 min read

Function Overloads in TypeScript

Function overloads let a single function accept different argument counts and types. Learn overload signatures, the implementation signature, and when to use a union instead.

TypeScript
Jul 17, 2026· 6 min read

Object Types in TypeScript

An object type describes the shape of a JavaScript object by listing its properties and their expected types. Learn how to write object types, what the compiler checks, and how they catch common bugs.

TypeScript
Jul 17, 2026· 5 min read

Optional Properties in TypeScript

Optional properties let you mark object properties as not required. Add a question mark after the property name, and TypeScript knows the value might be undefined. Learn the syntax and safe patterns.

TypeScript
Jul 17, 2026· 5 min read

Readonly Properties in TypeScript

Readonly marks TypeScript object properties as immutable at compile time. Add the modifier before a property name, and TypeScript prevents reassignment. Learn the syntax and its limits.

TypeScript
Jul 17, 2026· 5 min read

Type Aliases in TypeScript Explained

A TypeScript type alias is a name you give to any type. Use the type keyword to create reusable names for object shapes, unions, and tuples, and learn when to choose one over an interface.

TypeScript
Jul 17, 2026· 6 min read

Interface vs Type in TypeScript

Interfaces and type aliases both name object shapes in TypeScript, but they differ in merging, extension style, and what they can describe. Learn the key differences and when to choose each.

TypeScript
Jul 17, 2026· 5 min read

Excess Property Checks in TypeScript

Excess property checks catch unknown properties on object literals passed directly to typed positions. Learn when this check fires, when it does not, and how to handle it correctly.

TypeScript
Jul 17, 2026· 5 min read

Index Signatures in TypeScript

An index signature lets you type objects when you do not know the exact property names ahead of time, only the pattern of keys and values. Learn the syntax and when to use it.

TypeScript
Jul 17, 2026· 6 min read

Declaration Merging in TypeScript

Declaration merging lets you declare the same interface multiple times in the same scope. TypeScript combines them into one. Learn how merging works, where it is useful, and its rules.

TypeScript
Jul 17, 2026· 7 min read

Model Real Data with TypeScript Objects

Apply object types, interfaces, optional properties, and readonly to model a real dataset: a library of books. Build types step by step and see how the compiler guides correct data shapes.

TypeScript
Jul 17, 2026· 6 min read

Type Narrowing with instanceof in TypeScript

TypeScript uses the instanceof operator to narrow union types containing classes. Learn how it works with built-in types like Date and Error, custom classes, and the prototype chain.

TypeScript
Jul 17, 2026· 6 min read

Create a tsconfig File

A tsconfig.json file tells TypeScript how to compile your project. Learn how to create one, what the key sections mean, and which options to set first.

TypeScript