Skip to content

Instantly share code, notes, and snippets.

@Ladvace
Created May 31, 2022 10:13
Show Gist options
  • Save Ladvace/02057b9084f2876069e16d632faec983 to your computer and use it in GitHub Desktop.
Save Ladvace/02057b9084f2876069e16d632faec983 to your computer and use it in GitHub Desktop.
Symbol('bar') === Symbol('bar') // false, each of them it's a unique id, the "bar" it's just a description and not an unique key
Symbol.for('foo'); // create a new global symbol
Symbol.for('foo'); // retrieve the already created symbol
Symbol.for('bar') === Symbol.for('bar') // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment