3. Passing functions

Created Saturday 30 November 2013

function say (word) {

console.log (word);
}

function execute (someFunction, value) {

someFunction (value);
}

execute (say, "Hello");

// OR

function execute (someFunction, value) {

someFunction (value);
}

execute (function (word) {

console.log (word);
}, "Hello");



Backlinks: