Javascript - Function Functions Definition

Introduction

Functions in ECMAScript are declared using the function keyword, followed by a set of arguments and the body of the function.

The basic syntax is as follows:

function functionName(arg0, arg1,...,argN) {
    statements
}

Here's an example:

function displayMessage(name, message) {
    console.log("Hello " + name + ", " + message);
}

This function can be called by using the function name, followed by the function arguments enclosed in parentheses.

To call the displayMessage() function:

displayMessage("reader", "how are you today?");