Sail E0 Webinar

MCQs

Total Questions : 82 | Page 4 of 9 pages
Question 31. The output for the following code snippet would most appropriately be
var a=5 , b=1
var obj = { a : 10 }
with(obj)
  1.    10
  2.    Error
  3.    1
  4.    5
 Discuss Question
Answer: Option C. -> 1
Question 32. Which is a more efficient code snippet ?
Code 1 :
for(var
  1.    Code 1
  2.    Code 2
  3.    Both Code 1 and Code 2
  4.    Cannot Compare
 Discuss Question
Answer: Option A. -> Code 1
Question 33. A conditional expression is also called a
  1.    Alternate to if-else
  2.    Immediate if
  3.    If-then-else statement
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> Immediate if
Question 34. A statement block is a
  1.    conditional block
  2.    block that contains a single statement
  3.    Both conditional block and single statement
  4.    block that combines multiple statements into a single compound statement
 Discuss Question
Answer: Option D. -> block that combines multiple statements into a single compound statement
Question 35. When an empty statement is encountered, a JavaScript interpreter
  1.    Ignores the statement
  2.    Prompts to complete the statement
  3.    Throws an error
  4.    Throws an exception
 Discuss Question
Answer: Option A. -> Ignores the statement
Question 36. The “var” and “function” are
  1.    Keywords
  2.    Declaration statements
  3.    Datatypes
  4.    Prototypes
 Discuss Question
Answer: Option B. -> Declaration statements
Question 37. Consider the following statements
switch(expression)
{
statements
}
In the above switch syntax, the expression is compared with the case labels using which of the following operator(s) ?
  1.    ==
  2.    equals
  3.    equal
  4.    ===
 Discuss Question
Answer: Option D. -> ===
Question 38. The enumeration order becomes implementation dependent and non-interoperable if :
  1.    If the object inherits enumerable properties
  2.    The object does not have the properties present in the integer array indices
  3.    The delete keyword is never used
  4.    Object.defineProperty() is not used
 Discuss Question
Answer: Option A. -> If the object inherits enumerable properties
Question 39. Consider the following statements
var count = 0;
while (count
  1.    The values of count is logged or stored in a particular location or storage
  2.    The value of count from 0 to 9 is displayed in the console
  3.    An error is displayed
  4.    An exception is thrown
 Discuss Question
Answer: Option B. -> The value of count from 0 to 9 is displayed in the console
Question 40. 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
  1.    Prints the numbers in the array in order
  2.    Prints the numbers in the array in the reverse order
  3.    Prints 0 to the length of the array
  4.    Prints “Empty Array”
 Discuss Question
Answer: Option A. -> Prints the numbers in the array in order

Latest Videos

Latest Test Papers