Consider the code snippet given below
What is the observation made?
A. The omitted value takes “undefined”
B. This results in an error
C. This results in an exception
D. None of the mentioned
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
A. true false
B. false true
C. true true
D. None of the above
Select an option to see the answer and solution.
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
Select an option to see the answer and solution.
Consider the following code snippet :
What is the observation made ?
A. Skips the undefined elements
B. Skips the non existent elements
C. Skips the null elements
D. All of the mentioned
Select an option to see the answer and solution.
What will happen if reverse() and join() methods are used simultaneously ?
A. Reverses and stores in the same array
B. Reverses and concatenates the elements of the array
C. Reverses
D. All of the mentioned
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 ?
A. Returns [1,2,3]
B. Returns [4,5]
C. Returns [1,2,3,4]
D. Returns [1,2,3,4,5]
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
A. 1
B. [4,5]
C. [3,4,5]
D. Exception is thrown
Select an option to see the answer and solution.
The primary purpose of the array map() function is that it
A. maps the elements of another array into itself
B. passes each element of the array and returns the necessary mapped elements
C. passes each element of the array on which it is invoked to the function you specify, and returns an array containing the values returned by that function
D. None of the mentioned
Select an option to see the answer and solution.
The reduce and reduceRight methods follow a common operation called
A. filter and fold
B. inject and fold
C. finger and fold
D. fold
Select an option to see the answer and solution.
The method or operator used to identify the array is
A. isarrayType()
B. ==
C. ===
D. typeof
Select an option to see the answer and solution.
The function definitions in JavaScript begins with
A. Identifier and Parantheses
B. Return type and Identifier
C. Return type, Function keyword, Identifier and Parantheses
D. Identifier and Return type
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 ?
A. Prints the contents of each property of o
B. Returns undefined
C. All of the mentioned
D. None of the mentioned
Select an option to see the answer and solution.
When does the function name become optional in JavaScript?
A. When the function is defined as a looping statement
B. When the function is defined as expressions
C. When the function is predefined
D. All of the mentioned
Select an option to see the answer and solution.
What is the purpose of a return statement in a function?
A. Returns the value and continues executing rest of the statements, if any
B. Returns the value and stops the program
C. Returns the value and stops executing the function
D. Stops executing the function and returns the value
Select an option to see the answer and solution.
What will happen if a return statement does not have an associated expression?
A. It returns the value 0
B. It will throw an exception
C. It returns the undefined value
D. None of the mentioned
Select an option to see the answer and solution.
A function with no return value is called
A. Procedures
B. Method
C. Static function
D. Dynamic function
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?
A. Sum of square of a and b
B. Square of sum of a and b
C. Sum of a and b square
D. None of the mentioned
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?
A. var strict = (function { return this; });
B. mode strict = (function() { return !this; }());
C. var strict = (function() { return !this; }());
D. mode strict = (function { });
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?
A. o(x,y);
B. o.m(x) && o.m(y);
C. m(x,y);
D. o.m(x,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 :
A. 10*10+5
B. 105 as a string
C. 105 as an integer value
D. Exception is thrown
Select an option to see the answer and solution.