JavaScript high (8-10) importance

Problem 2016-02-11-23-31

complexity: 2 ; importance: 24; author: docentmail

Question: What would be result of execution of the snippet?

var x=1, y=1;
x
--
y
alert(x);
alert(y);


Problem 2016-02-11-17-42

complexity: 2 ; importance: 24; author: docentmail

Question: What is typeof null;?

alert(typeof null);


Problem 2016-01-17-01-18

complexity: 2 ; importance: 8; author: docentmail

Question: What would be the result of execution of the snippet?

function func1() { 
     var theVar="value1";
}

func1();
alert(theVar);


Problem 2016-01-17-00-27

complexity: 2 ; importance: 8; author: docentmail

Question: What would be result of execution of the snippet?

var theVar = 'value0'; 
 
function func1() { 
var theVar="value1";
  function func2() { 
     alert(theVar);
  }
  func2();
}
func1();


Problem 2016-01-17-01-01

complexity: 2 ; importance: 8; author: docentmail

Question: What would be result of execution of the snippet?

function func1() { 
     theVar="value1";
}

func1();

alert(theVar);


Problem 2016-01-17-00-01

complexity: 2 ; importance: 8; author: docentmail

Question: What would be result of execution of the snippet?

function func1() { 
   function func2() { 
       var theVar = 'Bye !'; 
       alert(theVar);
   }
}
func2();


Problem 2016-01-17-01-28

complexity: 2 ; importance: 8; author: docentmail

Question: What would be result of execution of the snippet?

var theVar="value0";     
for (var i=0; i<10; i++) { 
     var theVar="value1";
}

alert(theVar);


Problem 2016-01-17-03-36

complexity: 2 ; importance: 8; author: docentmail

Question: Give the code snippet that declares variable aVar with value 10 in local scope and not visible in Global scope


Problem 2015-12-29-20-02

complexity: 2 ; importance: 8; author: docentmail

Question: Is this valid JavaScript code?

var x= "Hello";
x=[1,2,3];
x=5;


Problem 2016-01-16-19-43

complexity: 2 ; importance: 8; author: docentmail

Question: Give the code snippet that declares variable aVar with value 10 in Global scope


Problem 2016-01-17-04-41

complexity: 2 ; importance: 8; author: docentmail

Question: Is this valid to call function before it is declared?

myFunction();
function myFunction(){
  alert("Hello from myFunction ");
}