© Raju Gandhi 2019
R. GandhiJavaScript Nexthttps://doi.org/10.1007/978-1-4842-5394-6_8

8. Hiding Behind Symbols

Raju Gandhi1 
(1)
Columbus, OH, USA
 

Introduction

Property naming in JavaScript objects presents one major obstacle, especially when working with third-party libraries or frameworks, which is, property name collisions. We have surrendered to the idea that we will be constrained in how we can or cannot name our variables and properties. Warning such as “Do not use $ prefix for the names of variables, properties and methods. This prefix is reserved for <INSERT FRAMEWORK/LIBRARY NAME HERE> usage” are common, and something we just take in stride.

Well no more!

In this chapter, we will see how a new data type introduced in ES6, namely Symbol, helps ...

Get JavaScript Next: Your Complete Guide to the New Features Introduced in JavaScript, Starting from ES6 to ES9 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.