calling a function js code example
Example 1: how to call a function in JavaScript
// calling our function
displayGreeting();
Example 2: 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>