Skip to content

Instantly share code, notes, and snippets.

@jarbaspsf
Created February 4, 2018 23:13
Show Gist options
  • Save jarbaspsf/cc2bbdeb22db1ecc5b6b1808b5e6169b to your computer and use it in GitHub Desktop.
Save jarbaspsf/cc2bbdeb22db1ecc5b6b1808b5e6169b to your computer and use it in GitHub Desktop.
passando funcao como argumento
let exibirResultado = (resultado) => console.log(`O Resultado da soma é: ${resultado}`);
let soma = (a, b, callback) => {
let resultado = a = b;
if(callback){
callback(resultado);
}
}
soma(14, 16, exibirResultado)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment