2 Program to demonstrate Function Expression in NodeJS

Program:

var displayMessage = function () {

    console.log(" This is a DisplayMessage Function");

}



var calculateSquare = function (number) {

    return number * number;

}



var makeDouble = function (n) {

    return n * 2;

}



console.log(makeDouble(calculateSquare(5)));

displayMessage();


Output:

Function Expression in NodeJS



Previous
Next Post »