Symbol

Noun · Development

Definitions

  1. An immutable, unique primitive value used as an identifier — in JavaScript, Symbols are globally unique keys that avoid property name collisions; in Ruby and Lisp, symbols are interned strings used as lightweight identifiers and hash keys that share a single memory allocation.

    In plain English: A special kind of label guaranteed to be one-of-a-kind, used when you need an identifier that can never accidentally match something else.

    Example: "I used a Symbol as the map key so no third-party library can accidentally overwrite it with a string collision."

Related Terms