JavaScript Closures
Closure is one of the important concept of Javascript. A closure is a function which has access to all variables from the other function. In other words, a closure is child functions which have access to all variables of their parent function. This is been done by creating a function inside the other function and most importantly they outer/ parent function is n ot able to access to the scope of inner/child function. In Javascript, the variable scope is either local or global. Local Variable: variables declared inside the function, function can full access to it. That is a local variable. e.g. <!DOCTYPE html> <html> <body> <p id="demo"></p> <script> function add() { let a=2; document.getElementById("demo").innerHTML=a*a; } add(); </script...