Learning JavaScript properly: the six concepts everything else rests on
JavaScript has a hundred features and six concepts. Learn the six and the rest is documentation.
JavaScript is easy to start and easy to learn badly, because you can build things that work while misunderstanding how they work. That gap surfaces later as bugs you cannot explain, and it is why so many self-taught developers hit a wall around the six month mark.
Six concepts carry almost everything. Learn these properly and the rest of the language is documentation you look up when needed.
1. Values and references
Primitives are copied. Objects and arrays are referenced. This one distinction explains a whole class of bugs where a function "mysteriously" changes data outside itself, and where two variables that should be independent are not.
2. Functions as values
Functions can be stored in variables, passed as arguments and returned from other functions. Everything callback-based and every array method depends on this. If it feels strange, stop and get comfortable with it, because half the language assumes it.
3. Scope and closures
Which variables are visible where, and how an inner function keeps access to the variables around it after the outer function has finished. Closures sound academic and turn out to be everywhere: event handlers, React hooks, module patterns.
4. Asynchronous execution
This is the wall. JavaScript does not wait, so code written top to bottom does not execute top to bottom, and beginners fight this before they understand it.
Learn it in order: callbacks, then promises, then async and await. Skipping to async and await first is tempting and leaves you unable to debug anything, because you never learned what it is hiding.
If you have ever logged a value and got `undefined` when it clearly should have data, you have met this. Nothing is broken. The log ran before the data arrived.
5. The array methods
`map`, `filter`, `reduce`, `find`, `some`, `every`. These replace most loops you would otherwise write, and reading modern JavaScript without them is impossible because every codebase uses them constantly.
6. Destructuring and spread
Purely syntax, but syntax you cannot read modern code without. Every React tutorial and every current codebase uses both on nearly every line.
| Concept | Learn it because |
|---|---|
| Values vs references | Explains a whole class of confusing mutation bugs |
| Functions as values | Every callback and array method depends on it |
| Scope and closures | Event handlers and React hooks rely on it |
| Async execution | The most common source of beginner confusion |
| Array methods | You cannot read modern code without them |
| Destructuring and spread | Used on nearly every line of current code |
When to move to a framework
Move when you can build a small interactive page with plain JavaScript: fetch data, render it, handle a form, update the display, handle an error. If you cannot do that, React will feel like magic, and magic is impossible to debug.
The people who struggle most with React are almost always people who skipped this. React problems are usually JavaScript problems wearing a costume.
Practise where the friction is lowest
A real and underrated obstacle: beginners spend their first sessions fighting a local environment instead of writing code, and some quit there. Writing JavaScript in a browser playground from minute one removes that entirely.
Code With Squad includes an in-browser playground alongside its courses and mentorship for exactly this reason, and the mentorship covers the part that matters most at this stage: someone reading your code and telling you what is structurally wrong while it still happens to work. It is built by CodeAiMan, whose web development team works in React, Next.js and TypeScript daily.
Frequently asked questions
Referenced in this article
CWS (Code With Squad)
Coding education platform with courses, an in-browser code playground and one-to-one mentorship.
OpenWeb development
Custom websites and web apps in React, Next.js and TypeScript, including PWAs and API work.
OpenCodeAiMan
AI-first web, app and software development company based in Ahmedabad, working with clients across India and internationally.
OpenMore guides on performance, SEO, AI and engineering are on the tech blog index, and the free tools section covers the browser utilities that come up in this work.
All tech articles