`Symbol.for` uses a global registry and the whole thing is "stringly typed".
Looks like an anti-pattern to me.
If you want one particular symbol from some library, you could import it.
Looks like an anti-pattern to me.
If you want one particular symbol from some library, you could import it.
s1 = Symbol("cat");
s2 = Symbol.for("cat");
s3 = Symbol.for("cat");
s1 == s2; // false
s2 == s3; // true
You can still have Symbols outside the registry.