Created
February 4, 2018 23:13
-
-
Save jarbaspsf/cc2bbdeb22db1ecc5b6b1808b5e6169b to your computer and use it in GitHub Desktop.
passando funcao como argumento
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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