JavaScript symbol data type

JavaScript symbol data type


JavaScript symbol data type
In JavaScript, Symbols are a new primitive type introduced in ES6. Symbols are completely unique identifiers. Just like their primitive counterparts (NumberStringBoolean), they can be created using the factory function Symbol() which returns a symbol That enables a form of weak encapsulation or a weak form of information hiding.
Example
Output