Find: Incorrect Type Import
Question
This code has a type error. Find the mistake:
Code
import { Person } from "./types";
const p = new Person();
Hint
Types and interfaces don't exist at runtime. Can you use 'new' with them?
Explanation
If Person is an interface or type alias (not a class), it cannot be used with new — types are erased at compile time and have no runtime existence. TypeScript errors: 'Person' only refers to a type, but is being used as a value here. Fix: if Person is a type, create an object literal: const p: Person = { ... }. If you need a constructor, use a class.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.