🔺Symbol

JSvalueprimitive ⟩ symbol

returns a primitive value that's guaranteed to be unique.

const unique = Symbol()    // ⭐️ not `new Symbol()`❗️ 
let obj = {
    [unique]: <value>,     // symbol used as a computed property name
};

Symbols

Last updated