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()}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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()}