Skip to content
RED SAGSkills
hard20 pts · first answer countstypescript

When extra properties are an error

Which line or lines does TypeScript report as an error?

type User = { name: string }

const data = { name: 'Ana', age: 30 }
const a: User = data                       // line A
const b: User = { name: 'Ana', age: 30 }   // line B
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions