call function from variable javascript code example
Example 1: running a function in a function javascript
function runFunction() {
myFunction();
}
function myFunction() {
alert("runFunction made me run");
}
runFunction();
Example 2: javascript function call with variable
function abc() {
alert('test');
}
var funcName = 'abc';
window[funcName]();