Asumir que toda variable no esta declarada a menos que se especifique lo contrario
function hola(miVariable) { console.log(miVariable); } var miVariable = 1; hola();
undefined
function hola(miVariable) { console.log(miVariable); } var miVariable = 1; hola("mundo");
"mundo"
function hola(){ var miVariable = 1; return; } hola(); console.log(miVariable);
Uncaught ReferenceError: miVariable is not defined
By Alejandro Oviedo García
Alejandro is a developer who loves learning new things. He is passionate about education, electronics, Open Source, and community-driven events.