5 ms·
s1 = Symbol("cat"); s2 = Symbol.for("cat"); s3 = Symbol.for("cat"); s1 == s2; // false s2 == s3; // true You can still have Symbols outside the
by towelguy 11y ago
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.
- artursapek 11y agoThat I understand. What I don't understand is why s2 and s3 shouldn't just be vanilla strings.