Select Page
JavaScript ES6+ : Symbols
Jayman Pandya
May 22, 2020

Symbol is the 7th primitive type in JavaScript after number, string, object, boolean, null and undefined. Symbols are unique identifiers that have descriptors. Symbols can avoid naming collisions. We cannot loop over symbols.

const FirstTestSymbol = Symbol('MySymbol');
const SecondTestSymbol = Symbol('MySymbol');

FirstTestSymbol === SecondTestSymbol; //returns false
FirstTestSymbol == SecondTestSymbol; //returns false

Peace ✌️

Let's Talk

If you liked what you have seen, then let’s connect and make something amazing together.

Email me at converse@jaymanpandya.com or send a DM on my twitter @jaymanpandya