what is call() in javascript code example

Example 1: calling function from function object javascript

var runApp = {

    init: function(){   
         this.run()
    },

    run: function() { 
             alert("It's running!");
    }
};

runApp.init();

Example 2: call function javascript

// Define your function
function sayHello(msg){
	console.log("Hello, " + msg);
}

// Call it
sayHello("Norris");

// outputs:
// Hello, Norris

Example 3: how do i call a js method?

<button onclick="sayHello()">say hello</button>  <script>    'use strict';  //force the context to be undefined    function sayHello() {      console.log(this);      console.log(arguments);      console.log('hello');    }  </script>