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;
}
```