Skip to content

Instantly share code, notes, and snippets.

@mutuadavid93
Created May 2, 2017 10:37
Show Gist options
  • Save mutuadavid93/fae034fd52e114e924990bc7315a589b to your computer and use it in GitHub Desktop.
Save mutuadavid93/fae034fd52e114e924990bc7315a589b to your computer and use it in GitHub Desktop.
/*
* Demonstarting function callbacks
*/
function foo(Goon) {
console.warn("Hello from: "+Goon);
}
function galon(company){
console.log("Greatings from: "+company);
}
function caller(f, g) {
// Call the given function
var company = "Yammer Inc.";
var com = "Alternate Ltd.";
f(company);
g(com);
}
caller(foo, galon); // Invokes foo() and galon()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment