Created
October 31, 2014 15:56
-
-
Save a0viedo/941757b264056ca1d055 to your computer and use it in GitHub Desktop.
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
//cuentaRecursiva recibe un número y cuenta cuantas veces lo tiene que decrementar por uno para llegar a cero (caso base) | |
function cuentaRecursiva(numero){ | |
if(numero === 0) { | |
return 0; | |
} | |
return 1 + cuentaRecursiva(numero - 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment