Symbols
We'll cover the following...
Symbols are a new primitive data type in JavaScript, they can to create anonymous keys for object properties, among other things. One key feature of these properties is that they do not show up in a for..in
loop. Symbols are created using the Symbol
function and passed a description.
Press + to interact
const mySym = Symbol('name');
No two symbols are the same, if we created another Symbol('name')
it would be completely different.
Symbols for private keys
Because of a ...