Javascript Quiz Parte 2

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

Javascript Quiz Parte 2

By Alejandro Oviedo García

Javascript Quiz Parte 2

  • 2,135