Created
February 28, 2017 18:03
-
-
Save ivandevp/8a91394822fd76efbd5ab41967735963 to your computer and use it in GitHub Desktop.
Function Statement vs. Function Expression
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 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