DEV Community

Discussion on: Progmattic method chaining

abhinav1217 profile image
Abhinav Kulshreshtha • Edited on

According to MDN docs, its not exactly eval. Every function in js is an object of Function class, so this is just manual work to implement same thing.

One drawback is that this will create an object everytime for execution and mark it for garbage collection, so if you have a fix set of functions that just needs to be called dynamically, use conditional logic like `if ('add') { this.add()}