πŸ“Š JavaScript
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
πŸ’¬ Discuss
βœ… Correct Answer: (A) 10

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
257
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Vishal Gupta
Publisher
πŸ“ˆ
97%
Success Rate