JavaScript Professional — Medium
Key points
- The IIFE pattern allows for private variables in JavaScript
- The `increment` method uses a closure to access and modify the private `count` variable
- The `getCount` method returns the current value of the `count` variable
Ready to go further?
Related questions
