MCQs > IT & Programming > JavaScript > Which are correct closure functions?

JavaScript MCQs

Which of the following are correct closure functions?

Answer

Correct Answer: Function foo(x) { Var tmp = 3; Return function (y) { Alert(x + y + (++tmp)); } } Var bar = foo(2); // bar is now a closure. Bar(10)

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it