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 Class Initialization and Field Initializers

Learn how to initialize TypeScript classes, set fields, and use constructors or object assignment instead of C#-style object initializers.

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 Dictionary Initialization and Structural Type Checking Explained

Learn why a TypeScript dictionary may accept invalid-looking values and how structural type checking works with object literals.

typescriptdictionaryinitialization

TypeScript Dictionary Objects: How to Type Key-Value Objects

Learn how to type dictionary-style objects in TypeScript using index signatures, Record, and when to use objects vs arrays.

typescriptarraysobjectdictionary

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 export vs default export: What’s the Difference?

Learn the difference between export and default export in TypeScript, how imports work, and why TS1192 happens in real projects.

typescriptjavascriptecmascript-6

TypeScript setTimeout Return Type: Node vs Window Explained

Learn why TypeScript resolves setTimeout differently in Node and browsers, and how to use the correct return type safely.

typescriptsettimeout

TypeScript tsconfig Paths: How Path Mapping Works with Webpack

Learn how to use tsconfig.json paths in TypeScript, when baseUrl is needed, and how to make path aliases work with Webpack.

typescriptnode-modulestsconfig

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 "JSX element type does not have any construct or call signatures" in React and TypeScript

Learn why this React TypeScript JSX error happens and how to type component props correctly with practical examples and fixes.

typescriptreactjs

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

Page 5 of 6 - 112 questions