TypeScript · Senior · Question 63 of 75

What is { id: string } & { id: number }?

Explanation

Conflicting intersections don't fail immediately; errors appear later in confusing places. Prefer interface extends, which reports conflicts at once.

Further reading

Problem with a question

TypeScript · Senior · question 63

Test yourself

Take the TypeScript · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz