COMP6080

Web Front-End Programming

Javascript

Closures

Closures

Javascript "closures" is a concept that a few programming languages have (e.g. Python too).
 

Closures allow us to create execution environments (similar to what a new object in a class does). This used to be needed before ES6 especially through the use of IIFE.

 

Since ES6 (modern javascript) they are virtually never needed, and even more rarely used. However, understanding the basics of them is still important.

 

We will demo some a very basic example.
 

 

Another demonstration of their use can be found here.

 

Feedback

Copy of COMP6080 - Javascript Closures

By haydensmith

Copy of COMP6080 - Javascript Closures

  • 381