Do functions in JavaScript necessarily return a value ?
Do functions in JavaScript necessarily return a value ?
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
What is the fundamental rule of lexical scoping?
What is the fundamental rule of lexical scoping?
Which of the following are examples of closures?
Which of the following are examples of closures?
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 :
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 ?
What is the opposite approach to the lexical scoping?
What is the opposite approach to the lexical scoping?
A function with no return value is called
A function with no return value is called
The method or operator used to identify the array is
The method or operator used to identify the array is
Which of the following uses a lot of CPU cycles?
Which of the following uses a lot of CPU cycles?
The pop() method of the array does which of the following task ?
The pop() method of the array does which of the following task ?
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 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
Consider the code snippet given below
What is the observation made?
Consider the code snippet given below
What is the observation made?
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);
The primary purpose of the array map() function is that it
The primary purpose of the array map() function is that it
What is the purpose of the dynamic scoping?
What is the purpose of the dynamic scoping?
What kind of scoping does JavaScript use?
What kind of scoping does JavaScript use?
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 will happen if reverse() and join() methods are used simultaneously ?
What will happen if reverse() and join() methods are used simultaneously ?
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 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?
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 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 :
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
What is a closure?
What is a closure?
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?
For the below mentioned code snippet:
The equivalent statement is:
For the below mentioned code snippet:
The equivalent statement is:
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
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?
When does the function name become optional in JavaScript?
When does the function name become optional in JavaScript?
Consider the following code snippet :
What is the observation made ?
Consider the following code snippet :
What is the observation made ?
What is the purpose of a return statement in a function?
What is the purpose of a return statement in a function?
What must be done in order to implement Lexical Scoping?
What must be done in order to implement Lexical Scoping?
The function definitions in JavaScript begins with
The function definitions in JavaScript begins with
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 ?
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?