JavaScript, Functional Programming, Web Development, State Encapsulation, Javascript State.
benefit when you consider the power and explicitness that it gives you. Closures enable a strong contract The variable is conceptually “saved” inside the object returned from the function thanks to Javascript closures. This means that we can set the value with the setter method (i.e. x.set(2)), but