Created
May 21, 2014 17:14
-
-
Save alanhoff/9f2221be4bf153ea79dc to your computer and use it in GitHub Desktop.
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
| // Definindo uma função no escopo global | |
| global.somar = function(a, b){ | |
| return a + b; | |
| }; | |
| // Agora em qualquer lugar do seu projeto, dentro do mesmo | |
| // processo, você pode chamar esta função | |
| var total = somar(1 + 2); | |
| console.log(total); // 3 | |
| // ********************************** | |
| // **** LEMBRANDO QUE ESSA É UMA **** | |
| // **** PRÁTICA NÃO RECOMENDADA **** | |
| // ********************************** | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment