1.

What is closure?(a) Function objects(b) Scope where function’s variables are resolved(c) Both Function objects and Scope where function’s variables are resolved(d) Function return valueThe question was posed to me in an interview for internship.This intriguing question originated from Closures topic in portion Lexical Structures of JavaScript

Answer»

The correct choice is (c) Both Function objects and Scope where function’s VARIABLES are RESOLVED

The best explanation: A combination of a function OBJECT and a scope (a set of variable bindings) in which the function’s variables are resolved is called a CLOSURE.



Discussion

No Comment Found

Related InterviewSolutions