A

Admin • 828.03K Points
Coach

Q. Which of the following is the correct output for the following JavaScript code:

Code:
functiondisplayArray(x)
{
varlen=x.length,i=0;
if(len==0)
console.log("Empty Array");
else
{
do
{
console.log(x[i]);
} while (++i<len);
}
}
  • (A) Prints the numbers in the array in specific order
  • (B) Prints the numbers in the array in the reverse order
  • (C) Prints "Empty Array"
  • (D) Prints 0 to the length of the array
  • Correct Answer - Option(A)
  • Views: 9
  • 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.