Q. Consider the following code snippet :
What does the last statement return ?
Code:
What does the last statement return ?
function constfunctions()
{
var functions = [];
for(var k = 0; k < 10; k++)
functions [k] = function() { return k; };
return functions ;
}
var functions = constfunctions();
functions [5]()
β
Correct Answer: (A)
10