SpinTheMic
Pro

Explain it in 60 seconds

Type annotations vs type inference

Frontend Engineering · TypeScript · Beginner

What is the difference between type annotations and type inference in TypeScript?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Annotations: explicit types (let x: number).
  • Inference: compiler deduces from values.
  • Rely on inference for locals.
  • Annotate function parameters, public APIs.
  • Return types optional but helpful.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics