Reputation: 770
Is there a way to get a Symbol description in TypeScript just like it's done with JavaScript?
Example,
const x = Symbol('x');
console.log(x.description) // returns 'x' in Javascript but error in TypeScript.
Upvotes: 1
Views: 70
Reputation: 3230
It is ES2019 feature, so you need to add "lib": ["es2019"]
to compilerOptions
section of your tsconfig.json.
Upvotes: 2