JS Functions
Syntax
A function in JavaScript is a reusable block of code defined with the function keyword, which can take parameters and return a value.
function functionName() { // Code to execute}
// Call functionfunctionName();functionName = function() { // Code to execute}
// Call functionfunctionName();Example
function sayHello() { console.log('Hello World');}
sayHello();
//Output: Hello World