Symbols are useful to us because we can create unique keys that are more secure than ID numbers, or string keys while the program is running.
The symbol data type does have two special methods attached to it; these two methods allow us to maintain a list of symbols while the program is running. This list is the global symbol registry, and it provides us with global symbols.
This method returns a symbol with the specified key or creates a new symbol if it doesn’t exist yet on the global symbol registry. Any symbol created with this method is always a global symbol.
This method returns the key from the global symbol registry for the specified global symbol; this is useful if you want to know the key given to any specific global symbol.
Below, I’ll show you how to create a symbol and how each symbol method works.
Symbols are great for cryptography, and extremely useful if you want to make unique keys for data or special functions while the program is running.
With that said, I hope this new feature can help improve your code just a little bit. And, if you think this could help someone else, please share it down below.