Question: what is the difference between closure and nested function in javascript?
Answer: One function written inside another function is called a nested function. ... Every function so created has a scope chain associated with which helps us in accessing the variables value. Now what are closures? Closures - the nested functions continue to live even when the outer function has completed is closure.