Skip to content

Instantly share code, notes, and snippets.

@heronmedeiros
Created August 26, 2011 19:12
Show Gist options
  • Save heronmedeiros/1174179 to your computer and use it in GitHub Desktop.
Save heronmedeiros/1174179 to your computer and use it in GitHub Desktop.
Exemplo de callback em JS
function doSomething(callback) {
// faca algo de util
// chama o callback
callback('coisas', 'aqui');
}
function funcaoComCallback(a, b) {
// callback
alert(a + " " + b);
}
doSomething(funcaoComCallback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment