Skip to content

Instantly share code, notes, and snippets.

@lcomino
Last active September 6, 2015 21:44
Show Gist options
  • Save lcomino/237ab53e96d0be793acf to your computer and use it in GitHub Desktop.
Save lcomino/237ab53e96d0be793acf to your computer and use it in GitHub Desktop.
Resposta da Aula 4 de JS Funcional - WebSchool - Suissa
function somar(a, b){
return a + b;
}
function multiplicar(operacao, numero, vezes){
var i = 1,
resultado = 0;
while(i <= vezes){
resultado = operacao(resultado, numero);
i++;
}
return resultado;
}
multiplicar(soma, 2,333); //666
multiplicar(soma, 4, 105); //420
//faltando a divisão ainda :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment