Get Programming with JavaScript - Listing 6.06

Listing 6.06 - A collection of functions that return values

var getMessage; var getHelloTo; var add; var totalCost; getMessage = function () { return "I’m going on an adventure!"; }; getHelloTo = function (name) { return "Hello to " + name; }; add = function (number1, number2) { return number1 + number2; }; totalCost = function (callOutCharge, costPerHour, numberOfHours) { return callOutCharge + costPerHour * numberOfHours; };