Skip to content

Instantly share code, notes, and snippets.

@ivandevp
Created February 28, 2017 18:03
Show Gist options
  • Select an option

  • Save ivandevp/8a91394822fd76efbd5ab41967735963 to your computer and use it in GitHub Desktop.

Select an option

Save ivandevp/8a91394822fd76efbd5ab41967735963 to your computer and use it in GitHub Desktop.
Function Statement vs. Function Expression
// Function Statement
// -------- ----------
// function saludo (nombre) {
// return "Hola " + nombre + "! :)";
// }
// console.log(saludo("Ivan"));
// Function Expression
// -------- ----------
// Función como valor (Function as value)
var saludo = function (nombre) {
return "Hola " + nombre + "! :)";
};
var nombre = "sahgvbsajkldm";
var numero = 123456;
console.log(saludo("Ivan"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment