Get Programming with JavaScript - Listing 4.04
Listing 4.04 - A simple function definition and assignment
var sayHello;
sayHello = function () {
console.log("Hello World!");
};
Further Adventures
Listing 4.04 - A simple function definition and assignment - Tasks 2 & 3
- At the end of the program, add code to make the function run.
- Run the program.
var sayHello;
sayHello = function () {
console.log("Hello World!");
};
sayHello(); // Call the function