News for hackers. Stuff that matters.
Re:TypeScript 5.2's New Keyword: 'using' by mostlylurks on Monday June 19, 2023 @10:55AM (#36391774)
> So if we know Symbol.dispose in advance we can simplify the code?

Symbol.dispose is not a string, but a symbol. Its value cannot be written out in the code, only referred to indirectly (that is basically what symbols are for), nor is there special syntax for properties with symbol keys like there is for properties with string keys, because that would be a nonsensical proposition due to the aforementioned fact. Thus, you cannot just write the property name directly, you have to use the computed property name syntax: [Symbol.dispose].

There are no comments on this comment yet.