Questions

TypeScript questions

Choose a question page, learn the concept, then test your understanding with a quiz.

TypeScript Arrow Functions with Generics: Syntax and Examples

Learn the syntax for generic arrow functions in TypeScript with clear examples, pitfalls, and practical usage in real code.

typescript

TypeScript Constructor Overloading: How to Use Overload Signatures Correctly

Learn how constructor overloading works in TypeScript using overload signatures and a single implementation with clear examples.

typescriptconstructoroverloading

TypeScript Function Overloading Explained

Learn how TypeScript function overloading works, why duplicate identifier errors happen, and how to write correct overloads with examples.

typescriptoverloading

TypeScript Getters and Setters: How to Use get and set Correctly

Learn how getters and setters work in TypeScript, including syntax, examples, common mistakes, and how to define property accessors correctly.

typescript

TypeScript Index Signatures vs Mapped Types with Enums

Learn why TypeScript index signatures cannot use enum unions and how to fix it with mapped types and Record objects.

typescriptjavascript

TypeScript Indexed Access Types: Get a Value Type from a Key

Learn how to get a property value type from a key in TypeScript using generics and indexed access types like T[K].

typescript

TypeScript Non-Null Assertion Operator (!) Explained

Learn what the TypeScript non-null assertion operator (!) does, how it works, when to use it, and safer alternatives with examples.

typescript

TypeScript unknown vs any: Differences, Safety, and When to Use Each

Learn the difference between TypeScript unknown and any, when to use each, and how unknown improves type safety in real code.

typescripttypescript3.0

Typing React onChange Event.target.value in TypeScript

Learn how to correctly type React input onChange events in TypeScript without using any, including event types and reusable props.

typescriptreactjstypestypescript-typings

Understanding "not assignable to parameter of type never" in TypeScript

Learn why TypeScript infers `never[]` for empty arrays and how to fix the "not assignable to parameter of type never" error.

typescript

Understanding .d.ts Declaration Files in TypeScript

Learn what .d.ts files do in TypeScript, how they relate to .ts and .js files, and when you can use declaration files instead of source code.

typescript

Understanding TS18003: No Inputs Were Found in tsconfig.json for TypeScript Builds

Learn why TS18003 happens in tsconfig.json, how include and exclude work, and how to fix missing TypeScript input files in builds.

typescriptjsonvisual-studio-2015asp.net-core

Understanding Type 'string | undefined' Is Not Assignable to Type 'string' in TypeScript

Learn why optional properties become string | undefined in TypeScript and how to handle them safely with checks, defaults, and assertions.

typescript

Understanding TypeScript Record<K, T>: Definition, Usage, and Examples

Learn what Record<K, T> means in TypeScript, how it works, when to use it, and how it compares to object types and mapped types.

typescripttypescript2.0

Understanding the Experimental Decorators Warning in TypeScript

Learn why TypeScript shows the experimental decorators warning, even with tsconfig settings enabled, and how to troubleshoot it correctly.

typescriptdecoratorvisual-studio-code

What Is TypeScript and Why Use It Instead of JavaScript?

Learn what TypeScript is, how it extends JavaScript, and why developers use it for safer code, better tooling, and easier maintenance.

typescriptjavascript

What `as const` Means in TypeScript and When to Use It

Learn what `as const` does in TypeScript, how it affects literals and readonly tuples, and why it helps with safer code.

typescripttype-assertion

When to Put @types Packages in dependencies vs devDependencies in TypeScript

Learn how to decide whether @types packages belong in dependencies or devDependencies in TypeScript projects and libraries.

typescriptnpmtypescript-typingspackage.json

Why 'value' Does Not Exist on Type 'HTMLElement' in TypeScript

Learn why TypeScript reports 'value' missing on HTMLElement, and how to safely access input values using correct DOM types.

typescript

require() vs import in Node.js: Understanding CommonJS and ES Modules

Learn the difference between require() and import in Node.js, why default export errors happen, and how to fix module imports clearly.

typescriptnode.jsimportrequire

Page 4 of 4 - 80 questions