JavaScript high (8-10) importance
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);
complexity: 2 ; importance: 24; author: docentmail
Question: What is typeof null;?
alert(typeof null);
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);
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();
complexity: 2 ; importance: 8; author: docentmail
Question: What would be result of execution of the snippet?
function func1() {
theVar="value1";
}
func1();
alert(theVar);
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();
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);
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
complexity: 2 ; importance: 8; author: docentmail
Question: Is this valid JavaScript code?
var x= "Hello"; x=[1,2,3]; x=5;
complexity: 2 ; importance: 8; author: docentmail
Question: Give the code snippet that declares variable aVar with value 10 in Global scope
complexity: 2 ; importance: 8; author: docentmail
Question: Is this valid to call function before it is declared?
myFunction();
function myFunction(){
alert("Hello from myFunction ");
}