Language types

Symbol language type

Try the free JavaScript compiler

Symbols are primitive identity-bearing values. A fresh symbol is distinct from other fresh symbols regardless of description. Symbols may be property keys; ordinary symbol-keyed properties are discoverable through reflection.

Formal Syntax & Structure

javascript syntaxjavascript
const key = Symbol("item");

Working Example

Example Snippetjavascript
console.log(Symbol("x") === Symbol("x"));
JavaScript Reference