JavaScript ES6+ : Symbols

Follow me on twitter @jaymanpandya

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 ✌️

I am an UI designer with a flair for front-end development that makes any brand shine at what they do best. I am right now building amazing products for our clients both Indian and International at Interactive Digital Labs. I am part of the Design and Marketing Teams for Make WordPress and has spoken at local camps on Gutenberg as well as the importance of user experience. I am not intimidated by markup, languages, or tools: HTML to CSS, wireframing to prototyping, JavaScript to agile development, and design programs including Sketch, Adobe XD, Figma, Photoshop, Illustrator, InDesign etc. I love languages, and not just programming either. I speak English, Hindi, Marathi, and Gujarati. When I am not taking courses to improve my skills, I am trying new food, dabbling in filmmaking and photography, and running and cycling. Say hi to me on Twitter here @jaymanpandya.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.