Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    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.


That I understand. What I don't understand is why s2 and s3 shouldn't just be vanilla strings.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: