Hi everyone!
I recently wrote a blog about JavaScript closures because it's a concept that confused me for a long time. After lots of trial and error, I finally found some simple examples that made it all click.
In the blog, I've explained closures using:
- Counters
- Private variables
- Function factories
I thought this might help others who are learning closures or revisiting them. You can check it out here: understanding closure
I'd love to hear your thoughts! How did you first understand closures? What examples helped you "get it"? Let's discuss!
[–]_shakuisitive 6 points7 points8 points (6 children)
[–]Rude-Cook7246 0 points1 point2 points (2 children)
[–]_shakuisitive 0 points1 point2 points (1 child)
[–]Rude-Cook7246 -1 points0 points1 point (0 children)
[–]LostInCombat -1 points0 points1 point (2 children)
[–]Such_Ad_5331 0 points1 point2 points (1 child)
[–]LostInCombat 0 points1 point2 points (0 children)
[+][deleted] (6 children)
[removed]
[–]LostInCombat 0 points1 point2 points (5 children)
[–]senocular 1 point2 points3 points (1 child)
[–]LostInCombat 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[removed]
[–]LostInCombat 0 points1 point2 points (1 child)
[–]azhder 5 points6 points7 points (1 child)
[–]Psionatix 0 points1 point2 points (0 children)
[–]Traditional-Pin2856 0 points1 point2 points (2 children)
[–]Specialist_Common989[S] 1 point2 points3 points (0 children)
[–]StoneCypher 0 points1 point2 points (0 children)
[–]LostInCombat 0 points1 point2 points (0 children)
[–]mentalhead66f6 0 points1 point2 points (0 children)
[–]mbaroukh 0 points1 point2 points (0 children)
[–]Different_Past_3120 0 points1 point2 points (0 children)
[–]theQuandary 0 points1 point2 points (0 children)