About Lesson
In this JavaScript tutorial we are going to talk about JavaScript Symbols, so it is a new primitive type for JavaScript, it does not have a literal form, symbols are unique identifier., or we can say symbols are token that serves as unique id.
Now let’s create an example.
1 2 3 4 5 6 7 8 9 |
const symbol1 = Symbol() let name = Symbol("name") let lname = Symbol("lname") console.log(name) console.log(lname) |