Consider the following code snippet
function printArray( a)
{
var len = a. length, i = 0 ;
if ( len == 0 )
console. log (" Empty Array ") ;
else
{
do
{
console. log ( a[ i]) ;
} while ( ++ i < len) ;
}
}
What does the above code result?
A. Prints the numbers in the array in order
B. Prints the numbers in the array in the reverse order
C. Prints 0 to the length of the array
D. Prints “Empty Array”
Select an option to see the answer and solution.
What are the three important manipulations done in a for loop on a loop variable?
A. Updation, Incrementation, Initialization
B. Initialization,Testing, Updation
C. Testing, Updation, Testing
D. Initialization,Testing, Incrementation
Select an option to see the answer and solution.
Consider the following code snippet
function tail( o)
{
for (; o. next; o = o. next) ;
return o;
}
Will the above code snippet work? If not, what will be the error?
A. No, this will throw an exception as only numerics can be used in a for loop
B. No, this will not iterate
C. Yes, this will work
D. No, this will result in a runtime error with the message “Cannot use Linked List”
Select an option to see the answer and solution.
One of the special feature of an interpreter in reference with the for loop is that
A. Before each iteration, the interpreter evaluates the variable expression and assigns the name of the property
B. The iterations can be infinite when an interpreter is used
C. The body of the loop is executed only once
D. All of the mentioned
Select an option to see the answer and solution.
What will happen if the body of a for/in loop deletes a property that has not yet been enumerated?
A. The property will be stored in a cache
B. The loop will not run
C. That property will not be enumerated
D. All of the mentioned
Select an option to see the answer and solution.
What will be the step of the interpreter in a jump statement when an exception is thrown?
A. The interpreter stops its work
B. The interpreter throws another exception
C. The interpreter jumps to the nearest enclosing exception handler
D. None of the mentioned
Select an option to see the answer and solution.
Consider the following code snippet
while ( a != 0 )
{
if (spam>a == 1 )
continue;
else
a++ ;
}
What will be the role of the continue keyword in the above code snippet?
A. The continue keyword restarts the loop
B. The continue keyword skips the next iteration
C. The continue keyword skips the rest of the statements in that iteration
D. None of the mentioned
Select an option to see the answer and solution.
Consider the following code snippet
function f( o)
{
if ( o === undefined) debugger;
}
What could be the task of the statement debugger?
A. It does nothing but a simple breakpoint
B. It debugs the error in that statement and restarts the statement’s execution
C. It is used as a keyword that debugs the entire program at once
D. All of the mentioned
Select an option to see the answer and solution.
Among the keywords below, which one is not a statement?
A. debugger
B. with
C. if
D. use strict
Select an option to see the answer and solution.
The unordered collection of properties, each of which has a name and a value is called
A. String
B. Object
C. Serialized Object
D. All of the mentioned
Select an option to see the answer and solution.
The object has three object attributes namely
A. Class, parameters, object’s extensible flag
B. Prototype, class, objects’ parameters
C. Prototype, class, object’s extensible flag
D. Native object, Classes and Interfacces and Object’s extensible flag
Select an option to see the answer and solution.
Consider the following code snippet :
var book = {
" main title ": " JavaScript " ,
' sub-title ': " The Definitive Guide " ,
" for ": " all audiences " ,
author: {
firstname: " David " ,
surname: " Flanagan "
}
} ;
In the above snippet, firstname and surname are
A. properties
B. property values
C. property names
D. objects
Select an option to see the answer and solution.
A linkage of series of prototype objects is called as :
A. prototype stack
B. prototype chain
C. prototype class
D. prototypes
Select an option to see the answer and solution.
Consider the below given syntax
book[ datatype] = assignment_value;
In the above syntax, the datatype within the square brackets must be
A. An integer
B. A String
C. An object
D. None of the mentioned
Select an option to see the answer and solution.
To determine whether one object is the prototype of (or is part of the prototype chain of) another object, one should use the
A. isPrototypeOf() method
B. equals() method
C. === operator
D. none of the mentioned
Select an option to see the answer and solution.
Consider the following code snippet
The above prototype represents a
A. Function f
B. A custom constructor
C. Prototype of a function
D. Not valid
Select an option to see the answer and solution.
The purpose of extensible attribute is to
A. make all of the own properties of that object nonconfigurable
B. to configure and bring a writable property
C. “lock down” objects into a known state and prevent outside tampering
D. all of the mentioned
Select an option to see the answer and solution.
Identify the process done in the below code snippet
o = { x: 1 , y:{ z:[false,null, "" ]}} ;
s = JSON.stringify( o) ;
p = JSON. parse ( s) ;
A. Object Encapsulation
B. Object Serialization
C. Object Abstraction
D. Object Encoding
Select an option to see the answer and solution.
The basic purpose of the toLocaleString() is to
A. return a localised object representation
B. return a parsed string
C. return a local time in the string format
D. return a localized string representation of the object
Select an option to see the answer and solution.
Javascript is _________ language.
A. Programming
B. Application
C. None of These
D. Scripting
Select an option to see the answer and solution.