javascript what is a function code example
Example 1: define function in javascript
/* Declare function */
function myFunc(param) {
// Statements
}
Example 2: javascript functions
function sayHelloTo(to) {
alert(`Hello ${to}`);
}
sayHelloTo('World from Grepper')