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
//Aqui nós temos o contexto de execução global | |
function primeiraFuncao () { | |
//Aqui nós temos um contexto de execução | |
} | |
function secundaFuncao () { | |
//Aqui nós temos outro contexto de execução | |
} |
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
function primeiraFuncao() { | |
//Aqui nós temos um contexto de execução | |
var myVar = 'Oi'; | |
} | |
//Aqui nós temos o contexto de execução global | |
console.log( myVar ); //saída => undefined |
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
function primeiraFuncao () { | |
//Aqui nós temos um contexto de execução | |
myVar = 'Oi'; | |
} | |
//Aqui nós temos o contexto de execução global | |
var myVar; | |
primeiraFuncao(); | |
console.log( myVar ); //saída => Oi |
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
function primeiraFuncao () { | |
//o código da primeira função | |
function secundaFuncao () { | |
//o código da segunda função | |
} | |
} |
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
function primeiraFuncao () { | |
//o código da primeira função | |
segundaFuncao(); | |
function segundaFuncao () { | |
//o código da segunda função | |
terceiraFuncao(); | |
function terceiraFuncao () { | |
//o código da terceira função | |
myVar = 'Alo Mundo'; | |
} |
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 numero = 10; | |
function init () { | |
console.log( numero ); //undefined | |
var numero = 5; | |
} | |
init(); |
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
function init () { | |
var a = true; | |
while( a ) { | |
var b = true; | |
} | |
} |
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
function init () { | |
var a = undefined; | |
var b = undefined; | |
a = true | |
while( a ) { | |
b = true; | |
} | |
} |
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 numero = undefined; | |
numero = 10; | |
function init () { | |
var numero = undefined; | |
console.log( numero ); | |
numero = 5; | |
} | |
init(); |
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
function fazAlgo () { | |
//código vai aqui | |
} |
OlderNewer