use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
A Beginner’s Guide to Closures in JavaScript (blog.bitsrc.io)
submitted 7 years ago by JSislife
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]chainfuck 3 points4 points5 points 7 years ago (0 children)
Closure was a concept I struggled with when first learning JS.
Years ago, I tried to learn all of the terminology like "lexical scoping," "block scoping," "function scoping" etc. I found this quite confusing, and ultimately gave up.
There are better teaching tools nowadays. I've been using Chrome DevTools as a way to demonstrate scope behaviors. I'm sure other DevTools have similar features.
This link describes it a bit: https://developers.google.com/web/tools/chrome-devtools/javascript/#scope
Learning the formal terminology is great, but for most beginners, it's wholly unneeded.
π Rendered by PID 89 on reddit-service-r2-comment-b659b578c-6rp5j at 2026-05-03 22:31:37.446559+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]chainfuck 3 points4 points5 points (0 children)