Questions

TypeScript questions

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

Interfaces vs Type Aliases in TypeScript

Learn the difference between interface and type in TypeScript, when to use each, and how they behave in real codebases.

typescriptinterfacetypescript-types

JSX.Element vs ReactNode vs ReactElement in React TypeScript

Learn the difference between JSX.Element, ReactNode, and ReactElement in React TypeScript, including null returns and component typing.

typescriptjavascriptreactjs

Runtime Interface Type Checks in TypeScript: Why `instanceof` Does Not Work

Learn why TypeScript interfaces do not exist at runtime, why `instanceof` fails, and how to safely check object shapes instead.

typescriptjavascriptinterface

Strongly Typed Function Parameters in TypeScript

Learn how to type callback function parameters in TypeScript using function signatures instead of Function for safer code.

typescript

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 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 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

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 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

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

Page 2 of 2 - 32 questions