Vidyalelo
JavaScript · all questions

Array And Function
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

38

Questions

1/2

Page

Pick an option on a question to see the right answer and solution.

Consider the code snippet given below
var count = [1,,3];
What is the observation made?

Select an option to see the answer and solution.

Consider the following code snippet
var a1 = [,,,]; 
var a2 = new Array(3); 
0 in a1 
0 in a2
The result would be

Select an option to see the answer and solution.

The pop() method of the array does which of the following task ?

Select an option to see the answer and solution.

Consider the following code snippet :
if (!a[i]) continue ;
What is the observation made ?

Select an option to see the answer and solution.

What will happen if reverse() and join() methods are used simultaneously ?

Select an option to see the answer and solution.

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 ?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

The primary purpose of the array map() function is that it

Select an option to see the answer and solution.

The reduce and reduceRight methods follow a common operation called

Select an option to see the answer and solution.

The method or operator used to identify the array is

Select an option to see the answer and solution.

The function definitions in JavaScript begins with

Select an option to see the answer and solution.

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 ?

Select an option to see the answer and solution.

When does the function name become optional in JavaScript?

Select an option to see the answer and solution.

What is the purpose of a return statement in a function?

Select an option to see the answer and solution.

What will happen if a return statement does not have an associated expression?

Select an option to see the answer and solution.

A function with no return value is called

Select an option to see the answer and solution.

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?

Select an option to see the answer and solution.

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?

Select an option to see the answer and solution.

Which is an equivalent code to invoke a function m of class o that expects two arguments x and y?

Select an option to see the answer and solution.

Consider the following code snippet :
var grand_Total=eval("10*10+5");
The output for the above statement would be :

Select an option to see the answer and solution.