When I wrote below destructuring assignment code in TypeScript Playground.
const a = { name: 'teresa teng' };
let name;
({ name } = a);
console.log(name);
TSC throws:
'name' is deprecated.(6385)
lib.dom.d.ts(17642, 5): The declaration was marked as deprecated here.
Cannot assign to 'name' because it is a constant.(2588)
It works fine when I change the name
to some "unique" name like userName
. So I think some global variables are defined in TypeScript Playground, they are conflicts, right? If so, what are they?