DEV Community

Discussion on: 8 Useful JavaScript ES2019 Features to Know About

Collapse
 
yohanchoidev profile image
YC John

Symbol returns a unique value, not like string. When you assign an object property name with a symbol, the property only can be access with the symbol. So, it prevents overwriting object properties by mistake. Also, you can use it for an iterator.