TypeScript · Middle · Question 39 of 75

What is unique symbol?

Explanation

Each const with Symbol() gets its own unique symbol subtype, so TS distinguishes such keys. This is used for "hidden" properties and type branding. A plain symbol describes any symbol.

Further reading

Problem with a question

TypeScript · Middle · question 39

Test yourself

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

Take this quiz