Quantcast
Channel: How to execute a JavaScript function when I have its name as a string - Stack Overflow
Viewing all articles
Browse latest Browse all 38

Answer by Zibri for How to execute a JavaScript function when I have its name as a string

$
0
0

Depending on where you are you can also use:

this["funcname"]();self["funcname"]();window["funcname"]();top["funcname"]();globalThis["funcname"]();

or, in nodejs

global["funcname"]()

Viewing all articles
Browse latest Browse all 38

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>