Using eval () is considered "evil", especially in the example given by Danila - any part of JS will / can be executed in eval (). The best option, as stated in epascarello, is to use a square bracket notation to call a named function. It should be noted, however, that windowt will call a function in the global namespace - if the function is a method of an object, you must reference it as such.
source share