Last active
September 6, 2015 21:44
-
-
Save lcomino/237ab53e96d0be793acf to your computer and use it in GitHub Desktop.
Resposta da Aula 4 de JS Funcional - WebSchool - Suissa
This file contains hidden or 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
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