function call javascript code example
Example 1: how to call a function in JavaScript
// calling our function
displayGreeting();
Example 2: javscript call
myFunc.call(thisArg, ...args)
Example 3: calling function from function object javascript
var runApp = {
init: function(){
this.run()
},
run: function() {
alert("It's running!");
}
};
runApp.init();
Example 4: call function javascript
// Define your function
function sayHello(msg){
console.log("Hello, " + msg);
}
// Call it
sayHello("Norris");
// outputs:
// Hello, Norris