What is the purpose of a return statement in a function?
What is the purpose of a return statement in a function?
When does the function name become optional in JavaScript?
When does the function name become optional in JavaScript?
Consider the code snippet given below
What is the observation made?
Consider the code snippet given below
What is the observation made?
Which of the following uses a lot of CPU cycles?
Which of the following uses a lot of CPU cycles?
A function with no return value is called
A function with no return value is called
Consider the following code snippet :
var c = counter(), d = counter();
function constfuncs()
{
var funcs = [];
for(var i = 0; i < 10; i++)
funcs[i] = function() { return i; };
return funcs;
}
var funcs = constfuncs();
funcs[5]()
What does the last statement return ?
Consider the following code snippet :
var c = counter(), d = counter();
function constfuncs()
{
var funcs = [];
for(var i = 0; i < 10; i++)
funcs[i] = function() { return i; };
return funcs;
}
var funcs = constfuncs();
funcs[5]()
What does the last statement return ?
What kind of scoping does JavaScript use?
What kind of scoping does JavaScript use?
Do functions in JavaScript necessarily return a value ?
Do functions in JavaScript necessarily return a value ?
Consider the following code snippet :
var a = [1,2,3,4,5];
a.slice(0,3);
What is the possible output for the above code snippet ?
Consider the following code snippet :
var a = [1,2,3,4,5];
a.slice(0,3);
What is the possible output for the above code snippet ?
-
-
-
-
Consider the following code snippet :
var grand_Total=eval("10*10+5");
The output for the above statement would be :
Consider the following code snippet :
var grand_Total=eval("10*10+5");
The output for the above statement would be :
What will happen if reverse() and join() methods are used simultaneously ?
What will happen if reverse() and join() methods are used simultaneously ?
What is the purpose of the dynamic scoping?
What is the purpose of the dynamic scoping?
Which is an equivalent code to invoke a function m of class o that expects two arguments x and y?
Which is an equivalent code to invoke a function m of class o that expects two arguments x and y?
The primary purpose of the array map() function is that it
The primary purpose of the array map() function is that it
The function definitions in JavaScript begins with
The function definitions in JavaScript begins with
What is the opposite approach to the lexical scoping?
What is the opposite approach to the lexical scoping?
Consider the following code snippet
function hypotenuse(a, b)
{
function square(x)
{
return x*x;
}
return Math.sqrt(square(a) + square(b));
}
What does the above code result?
Consider the following code snippet
function hypotenuse(a, b)
{
function square(x)
{
return x*x;
}
return Math.sqrt(square(a) + square(b));
}
What does the above code result?
Consider the following code snippet :
var a = [];
a.unshift(1);
a.unshift(22);
a.shift();
a.unshift(3,[4,5]);
a.shift();
a.shift();
a.shift();
The final output for the shift() is
Consider the following code snippet :
var a = [];
a.unshift(1);
a.unshift(22);
a.shift();
a.unshift(3,[4,5]);
a.shift();
a.shift();
a.shift();
The final output for the shift() is
Consider the following code snippet
function printprops(o)
{
for(var p in o)
console.log(p + ": " + o[p] + "n");
}
What will the above code snippet result ?
Consider the following code snippet
function printprops(o)
{
for(var p in o)
console.log(p + ": " + o[p] + "n");
}
What will the above code snippet result ?
The pop() method of the array does which of the following task ?
The pop() method of the array does which of the following task ?
What must be done in order to implement Lexical Scoping?
What must be done in order to implement Lexical Scoping?
Which of the following is the correct code for invoking a function without this keyword at all, and also too determine whether the strict mode is in effect?
Which of the following is the correct code for invoking a function without this keyword at all, and also too determine whether the strict mode is in effect?
Consider the following code snippet :
var tensquared = (function(x) {return x*x;}(10));
Will the above code work ?
Consider the following code snippet :
var tensquared = (function(x) {return x*x;}(10));
Will the above code work ?
What is the fundamental rule of lexical scoping?
What is the fundamental rule of lexical scoping?
Consider the following code snippet
var a1 = [,,,];
var a2 = new Array(3);
0 in a1
0 in a2
The result would be
Consider the following code snippet
var a1 = [,,,];
var a2 = new Array(3);
0 in a1
0 in a2
The result would be
Which of the algorithmic languages is lexical scoping standardized in?
Which of the algorithmic languages is lexical scoping standardized in?
The reduce and reduceRight methods follow a common operation called
The reduce and reduceRight methods follow a common operation called
If you have a function f and an object o, you can define a method named m of o with
If you have a function f and an object o, you can define a method named m of o with
Consider the following code snippet :
What is the observation made ?
Consider the following code snippet :
What is the observation made ?
For the below mentioned code snippet:
The equivalent statement is:
For the below mentioned code snippet:
The equivalent statement is:
Consider the following code snippet :
var scope = "global scope";
function checkscope() {
var scope = "local scope";
function f()
{
return scope;
}
return f;
What is the function of the above code snippet?
Consider the following code snippet :
var scope = "global scope";
function checkscope() {
var scope = "local scope";
function f()
{
return scope;
}
return f;
What is the function of the above code snippet?
The method or operator used to identify the array is
The method or operator used to identify the array is
What will happen if a return statement does not have an associated expression?
What will happen if a return statement does not have an associated expression?
What is the difference between the two lines given below ?
!!(obj1 && obj2);
(obj1 && obj2);
What is the difference between the two lines given below ?
!!(obj1 && obj2);
(obj1 && obj2);
Consider the following code snippet :
var string2Num=parseInt("123xyz");
The result for the above code snippet would be :
Consider the following code snippet :
var string2Num=parseInt("123xyz");
The result for the above code snippet would be :
What is a closure?
What is a closure?
Consider the following code snippet :
var c = counter(), d = counter();
c.count()
d.count()
c.reset()
c.count()
d.count()
The state stored in d is :
Consider the following code snippet :
var c = counter(), d = counter();
c.count()
d.count()
c.reset()
c.count()
d.count()
The state stored in d is :
Which of the following are examples of closures?
Which of the following are examples of closures?