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?
var scope = "global scope";
function checkscope() {
var scope = "local scope";
function f()
{
return scope;
}
return f;
A. Returns value null
B. Returns exception
C. Returns the value in scope
D. None of the mentioned
Answer: Option C
Solution(By Examveda Team)
The above code snippet returns the value in scope.Consider the code snippet given below
var count = [1,,3];
A. The omitted value takes “undefined”
B. This results in an error
C. This results in an exception
D. None of the mentioned
A. true false
B. false true
C. true true
D. false true
The pop() method of the array does which of the following task ?
A. decrements the total length by 1
B. increments the total length by 1
C. prints the first element but no effect on the length
D. None of the mentioned
Consider the following code snippet :
if (!a[i]) continue ;
A. Skips the undefined elements
B. Skips the non existent elements
C. Skips the null elements
D. All of the mentioned
Join The Discussion