[X]

Every Symbol Is Unique

luljs still works

Two symbols with the same description are still different.

In 2026: Still works. Symbol() makes a brand new unique value every time, even with the same description text. So Symbol("id") === Symbol("id") is false. The description is only a label for debugging, which is what makes symbols safe as collision-proof object keys.

Where it came from: Each Symbol() call returns a fresh unique value regardless of description, per MDN's Symbol page. MDN

<script>
document.write('<p><code>Symbol("id") === Symbol("id")</code> is <b>' + (Symbol("id") === Symbol("id")) + '</b></p>');
var s = Symbol("id");
document.write('<p><code>s === s</code> is <b>' + (s === s) + '</b> (the same symbol)</p>');
document.write('<p>The description "id" is just a label; each Symbol() call is unique.</p>');
</script>
sandboxed demo · breaks nothing but itselfrestart

More in luljs

all 63 in luljs › · the whole library ›