News for hackers. Stuff that matters.
Re:JavaScript's New Superpower: Explicit Resource Management by mceachen on Saturday May 17, 2025 @12:57PM (#44015551)
Other posters correctly described _what_ this is, but I didn't see anyone answer _why_.

Using a Symbol as the method name disambiguates this method from any previously-defined methods.

In other words, by using a Symbol for the method name (and not using a string), it's impossible to "name collide" on this new API, which would accidentally mark a class as disposable.

Re:JavaScript's New Superpower: Explicit Resource Management by whizzter on Sunday May 18, 2025 @01:07AM (#44019135)
This is the most important reason!