Clouser :
One Line Answer clouser nothing but inner function can acess the outer function variables
In javascript clouser is a function that reference scope in the outerscop from its from scope .
a clouser gives you access to an outer function scope from an inner function
clouser creates every time a function is created at function creation time.
Lexical Scope :
Lexical Scope in JavaScript?
lexical scope defines the scope of the variable by position if that variable declared in the source code
Example of Lexical Scope
// Define a variable in the global scope:
const myName = "ramesh";
// Call myName variable from a function:
function getName() {
return myName;
}
notice that we defined the myName variable in the global scope and called it in the getName() function.
Remember that lexical scope means definition space — not invocation space. Therefore, myName’s lexical
scope is the global scope because we defined myName in the global environment