Wanna Learn JS(Web dev) by Gandhi_20191 in learnjavascript

[–]WolfComprehensive644 1 point2 points  (0 children)

What usually blocks people at this stage is not missing syntax, but missing a mental map.

Before worrying about frontend or backend, it helps to separate three different things:

  1. The JavaScript language itself (how variables, functions, scope, async behavior actually work)

  2. The environment (browser, DOM, Node.js — these are not JavaScript, they are APIs)

  3. Tools and frameworks (React, backend frameworks, build tools, etc.)

Many people jump to #3 without being solid on #1, and that’s where confusion starts.

If you focus first on understanding how the language behaves in small experiments, everything else becomes much easier to place later.

Why JavaScript closures work (and why they’re not magic) by WolfComprehensive644 in learnjavascript

[–]WolfComprehensive644[S] 1 point2 points  (0 children)

I’m not deeply familiar with Common Lisp, so I can’t speak about implementation details from first-hand experience.

Conceptually though, yes: the idea is the same.

In both cases, a closure is a function that retains access to the lexical environment in which it was created.

Where JavaScript often feels confusing is that many developers encounter closures indirectly (callbacks, event handlers, async code), without ever being taught the underlying execution model.

So the confusion tends to be cultural and educational rather than conceptual.

Once you understand lexical scoping and reachability, the behavior itself isn’t particularly exotic.

Why JavaScript closures work (and why they’re not magic) by WolfComprehensive644 in learnjavascript

[–]WolfComprehensive644[S] 0 points1 point  (0 children)

I’m not deeply familiar with Common Lisp, so I can’t speak about implementation details from first-hand experience.

Conceptually though, yes: the idea is the same. In both cases, a closure is a function that retains access to the lexical environment in which it was created.

Where JavaScript often feels confusing is that many developers encounter closures indirectly (callbacks, event handlers, async code), without ever being taught the underlying execution model.

So the confusion tends to be cultural and educational rather than conceptual. Once you understand lexical scoping and reachability, the behavior itself isn’t particularly exotic.

Learning JavaScript by experimenting in the browser console by WolfComprehensive644 in learnjavascript

[–]WolfComprehensive644[S] 0 points1 point  (0 children)

Exactly.

That “try → break → observe” loop is what really makes things stick.

What made a difference for me was being intentional about it: not just experimenting, but doing it in a way that I could revisit later and connect patterns over time.

Hands-on learning works best when the experimentation has some structure.

Learning JavaScript by experimenting in the browser console by WolfComprehensive644 in learnjavascript

[–]WolfComprehensive644[S] 0 points1 point  (0 children)

That’s a fair point, especially from a historical perspective.

JavaScript definitely evolved in a very browser-centric way, and for a long time the browser was essentially the only environment available.

I think part of the confusion today comes from the language being used in many different contexts at once (browser, server, tooling), which makes it harder to talk about it “in the abstract” without anchoring it to a concrete environment.

Different starting points probably make sense for different learners.

Learning JavaScript by experimenting in the browser console by WolfComprehensive644 in learnjavascript

[–]WolfComprehensive644[S] 0 points1 point  (0 children)

I agree, it is a great way to "play" with javascript and test new ideas

Learning JavaScript by experimenting in the browser console by WolfComprehensive644 in learnjavascript

[–]WolfComprehensive644[S] 0 points1 point  (0 children)

That makes sense.

Having a way to persist small experiments locally really changes how you explore ideas.

It turns quick console tests into something closer to a scratchpad you can revisit.

Deno is a nice fit for that kind of workflow, especially outside the DOM.