With the incoming of ES6(ES2105) the javascript has evolved like a Pokemon. with each passing day, you come across so many new features and shorthands that you want to rewrite some of your code and play around with these new tools available in your swiss knife.
Metaprogramming is all about the underlying mechanics of the language, rather than “high level” data modeling or business logic. If programming can be described as “making programs”, metaprogramming could be described as “making programs making programs”.
Javascript"s metaprogramming features are not that advanced yet (it has some code generation features like eval
since ES1) but now they have started to demand some attention.
So, ES6 brings us some new metaprogramming flavors and one of them is Symbol
. A new primitive like Number
, String
& Boolean
. It is one of the many new features introduced in ES6, but here we are gonna emphasize on how they can be useful and help our cause and obviously help us show off. Enjoy some of its examples and use cases described in this repository.
Corrections, Suggestions and PR"s will be greatly appreciated.