A

Admin • 833K Points
Coach

Q. Consider the following code snippet.
What does this code result?

Code:
function printArr(n)
{
var len = n.length, p = 2;
if (len == 2)
console.log("Nothing is in Array");
else
{
do
{
console.log(n[p]);
} while (++p < len);
}
}
  • (A) Prints the numbers in the array in the reverse order
  • (B) Prints the numbers in the array in order
  • (C) Prints “Nothing is in Array”
  • (D) Prints 2 to the length of the array
  • Correct Answer - Option(B)
  • Views: 18
  • Filed under category JavaScript
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.