A

Admin • 833K Points
Coach

Q. Consider the following code snippet :
What does the last statement return ?

Code:
function constfunctions()
{
var functions = [];
for(var k = 0; k < 10; k++)
functions [k] = function() { return k; };
return functions ;
}
var functions = constfunctions();
functions [5]()
  • (A) 10
  • (B) 9
  • (C) 0
  • (D) All of above
  • Correct Answer - Option(A)
  • Views: 28
  • 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.