Fill: Satisfies Operator
Fill in the Blank Medium
Question
Fill in the blank to check that config matches the type without widening:
Code
const config = { port: 3000 } ___ { port: number };
Hint
This operator validates a type while preserving the best inferred type.
Explanation
The operator is satisfies. config satisfies { port: number } checks that config matches the type but preserves the literal type 3000 instead of widening to number. It is safer than type assertions for validation.
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.