Last active
May 23, 2016 14:08
-
-
Save kodamirmo/fd465ee7f36e25c2fa2889293f7b5ed1 to your computer and use it in GitHub Desktop.
Funciones
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
var hacerSopa = function() { | |
return 'Hacer sopa'; | |
}; | |
var hacerTacos = function() { | |
return 'Hacer tacos'; | |
}; | |
var hacerMaruchan = function() { | |
return 'Hacer maruchan'; | |
}; | |
//MADRE | |
function cocinar(receta) { | |
return receta(); | |
}; | |
var resultado = cocinar(hacerTacos); | |
console.log(resultado); |
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
var saludarBuenaOnda = function (nombre) { | |
return '¡Que onda ' + nombre + '!'; | |
}; | |
var saludarMalaOnda = function (nombre) { | |
return nombre + ' vete a la $&%·$&'; | |
}; | |
saludarBuenaOnda('Irving'); | |
saludarMalaOnda('Pedro y el lobo'); | |
//nombre = String | |
//comoSaludar = Funcion | |
function saludar(nombre, comoSaludar) { | |
var saludo = comoSaludar(nombre); | |
console.log(saludo); | |
}; | |
saludar('Irving', saludarMalaOnda); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment