Javascript Quiz Parte 3

var var = 1;
console.log(var);

Uncaught SyntaxError: Unexpected token var

Palabras reservadas en Javascript

  • break
  • case
  • catch
  • continue
  • debugger
  • default
  • delete
  • do
  • else
  • finally
  • for
  • function
  • if
  • in
  • instanceof
  • new
  • return
  • switch
  • this
  • throw
  • try
  • typeof
var res = { a: 1 };
delete res.a;
console.log(res);

{}

function hola(){
    function mundo(){
        console.log(res);
    }
    var res = 1;
    
    mundo();
}

hola();

1

function hola(){
    var mundo = function (){ return console.log('hi');};
    console.log(mundo);
}

hola();

function (){ console.log('hi')} 

function hola(){
    var mundo = function (){ return 'hi';};
    console.log(mundo());
}

hola();

'hi'

Made with Slides.com