Archive for the ‘closures’ Category

JavaScript Scope and Closures

Scopes and closures are important in JavaScript. But, they were confusing for me when I first started. Here's an explanation of scopes and closures to help you understand what they are. Let's start with scopes. Scope A scope in JavaScript defines what...

JavaScript Design Patterns: The Singleton

Among languages used in widespread production, JavaScript is by far the most quickly evolving, looking less like its earliest iterations and more like Python with every new spec put forth by ECMA International. While the changes have their fair share o...

Quick Tip: Master Closures by Reimplementing Them from Scratch

Posted on: No Comments
This article was peer reviewed by Tim Severien and Michaela Lehr. Thanks to all of SitePoint's peer reviewers for making SitePoint content the best it can be! To say there are a lot of articles about closures would be an understatement. Most will expla...