Sail E0 Webinar

MCQs

Total Questions : 38 | Page 2 of 4 pages
Question 11. The function definitions in JavaScript begins with
  1.    Identifier and Parantheses
  2.    Return type and Identifier
  3.    Return type, Function keyword, Identifier and Parantheses
  4.    Identifier and Return type
 Discuss Question
Answer: Option A. -> Identifier and Parantheses
Question 12. 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 ?
  1.    Prints the contents of each property of o
  2.    Returns undefined
  3.    All of the mentioned
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> Returns undefined
Question 13. When does the function name become optional in JavaScript?
  1.    When the function is defined as a looping statement
  2.    When the function is defined as expressions
  3.    When the function is predefined
  4.    All of the mentioned
 Discuss Question
Answer: Option B. -> When the function is defined as expressions
Question 14. What will happen if a return statement does not have an associated expression?
  1.    It returns the value 0
  2.    It will throw an exception
  3.    It returns the undefined value
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> It returns the undefined value
Question 15. What is the purpose of a return statement in a function?
  1.    Returns the value and continues executing rest of the statements, if any
  2.    Returns the value and stops the program
  3.    Returns the value and stops executing the function
  4.    Stops executing the function and returns the value
 Discuss Question
Answer: Option D. -> Stops executing the function and returns the value
Question 16. A function with no return value is called
  1.    Procedures
  2.    Method
  3.    Static function
  4.    Dynamic function
 Discuss Question
Answer: Option A. -> Procedures
Question 17. 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?
  1.    var strict = (function { return this; });
  2.    mode strict = (function() { return !this; }());
  3.    var strict = (function() { return !this; }());
  4.    mode strict = (function { });
 Discuss Question
Answer: Option C. -> var strict = (function() { return !this; }());
Question 18. 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?
  1.    Sum of square of a and b
  2.    Square of sum of a and b
  3.    Sum of a and b square
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> Sum of square of a and b
Question 19. Consider the following code snippet :
var grand_Total=eval("10*10+5");
The output for the above statement would be :
  1.    10*10+5
  2.    105 as a string
  3.    105 as an integer value
  4.    Exception is thrown
 Discuss Question
Answer: Option C. -> 105 as an integer value
Question 20. Which is an equivalent code to invoke a function m of class o that expects two arguments x and y?
  1.    o(x,y);
  2.    o.m(x) && o.m(y);
  3.    m(x,y);
  4.    o.m(x,y);
 Discuss Question
Answer: Option D. -> o.m(x,y);

Latest Videos

Latest Test Papers