js what is a method code example
Example 1: javascript functions
function sayHelloTo(to) {
alert(`Hello ${to}`);
}
sayHelloTo('World from Grepper')
Example 2: what is a javascript method
JavaScript methods are actions that can be performed on syntax.
Examples of methods include syntax ending with ();
Examples:
console.log();
toUpperCase();
Math.floor();
They help change original syntax in various ways.