Tag: closure

  • What is a closure in Javascript?

    Let’s say you declare a variable in javascript. What is the scope of this variable? It is the entire function in which it is declared. What if it is declared within a particular block ? Still it’s scope is the entire function in which it is declared. For example: In the above code even though…