call function in object javascript code example
Example 1: javascript function call with variable
function abc() {
alert('test');
}
var funcName = 'abc';
window[funcName]();
Example 2: calling function from function object javascript
var runApp = {
init: function(){
this.run()
},
run: function() {
alert("It's running!");
}
};
runApp.init();