Explorer
Node.js

Write a function `createUniqueKeys()` that creates two symbols with the same description "id" and returns whether they are equal (they should NOT be).

Problem Statement

Write a function `createUniqueKeys()` that creates two symbols with the same description "id" and returns whether they are equal (they should NOT be).

Complexity

Time Complexity: -

Space Complexity: -

Hints

šŸ’” Hint 1: Symbol() creates a unique primitive value. šŸ’” Hint 2: Even with the same description, two Symbols are never equal. šŸ’” Hint 3: const s1 = Symbol("id"); const s2 = Symbol("id"); return s1 === s2; āœ… Solution: ```javascript function createUniqueKeys() { const s1 = Symbol("id"); const s2 = Symbol("id"); return s1 === s2; } ```

Symbol Basics

Easy
Write a function `createUniqueKeys()` that creates two symbols with the same description "id" and returns whether they are equal (they should NOT be).
Editor
Loading Editor...
Evaluate code
Output:Click "Run" above to execute and verify your code here.
false