How to learn and remember JavaScript: see, build and peg
By Kylo ยท ยท 11 min read

When I first started learning JavaScript, I may as well have jumped straight into machine learning. The outcome was the same: deep, dire confusion.
I believed I would eventually stop clicking the reveal solution and provide hint buttons. But as the weeks and months went by, my frustration grew.
- I was still clicking provide hint
- I still copy-pasted most of the code I "wrote"
- My only projects were course projects
- Heck, if AI assistants had existed back then, I would have let one write every line for me
Here is a very scientific chart of my confusion vs frustration:

If you have a similar chart, this guide is for you. It doesn't matter if yours covers 1-3 months or 5-10 years (not an uncommon story, and there are good reasons JavaScript is difficult).
The See, Build and Peg learning system
Here is the good news: your story has to start in the middle of frustration. It has to begin with deep, dire confusion. That's where the seeds of growth are planted, and where knowledge trees grow their roots. ๐ฑ
This is the system I used to break through my own JavaScript struggles. It's what I teach students of The Great Sync, and how I've coached junior developers in my teams. It has 3 parts:
- See the Model
- Build Sand Castles
- Peg the Washing
But before we dive in, there's an important foundation to lay.
You need two cars to learn JavaScript
I usually hate car analogies because there are a gazillion of them, but this one works, so please forgive me.
The first car is a race car ๐๏ธ: theory and coursework.
- It's comfortable. Guided tutorials and courses take you step by step, give you direction, and even help you finish projects.
- It carries the theory and industry patterns you need to get a job.
The second car is a slow truck ๐: self-guided project work.
- It forces cognitive effort, which is the essential learning ingredient.
- It makes you practise solving problems on your own.

Each demands its own time, dedication, consistency and accountability. But they are not built the same. Self-guided projects are slow and cumbersome, with no navigation system. Theory and coursework feels more productive, and the course chapters hand you a roadmap. It's more exciting too, like any race car.
But this isn't a race between them. You need both cars to gain confidence with JavaScript.
Don't negotiate with the Imp
Many people ask me for a faster way to master JavaScript. Let me tell you what happens when you look for a route around the hard work: you end up negotiating with the Imp.

This little creature lives in The Great Sync. He loves convincing you that Learn JS in 1 hour videos will actually work. These days he has a new favourite line: with an AI assistant in every editor, why bother understanding the code? Just accept the suggestion.
Answers have never been closer. They're one prompt away. Yet confidence among learners is lower than ever, because every time you skip the thinking, you skip the learning. You end up with code that works but that you couldn't explain, change or rebuild.
The Imp is your imposter syndrome, and he's devious! There are no shortcuts to becoming a developer. (If he's whispering that you should give up altogether, read that first.)
The 4 stages of learning, and how to split your time
So how much time should each car get? It depends on where you are in your journey. These charts are a rough guide for 4 stages:
- First Weeks: you're a raw beginner.
- Fluency Building: JS is still new, and you're getting comfortable with the syntax.
- Mental Model Growth: an exciting period where you start making sense of what you've learnt and putting it into practice.
- Confidence Growth: your one objective is to apply JavaScript and build things without feeling like a total imposter.




See, Build and Peg is how you keep both cars driving. It begins with seeing the model.
Step 1: See the Model ๐
I didn't study computer science. I hated computers. I almost gave up learning JavaScript. Today I'm a full stack developer building commercial applications. How did that happen? ๐
My breakthrough was finding a way to see JavaScript, and the bigger picture.
Without a translation or a change in perspective, every confusion, misunderstanding and misconception stays fixed. JavaScript turns into a brick wall ๐งฑ. A shift in perspective helps you connect the dots and get past it.
How your mental model evolves
Perspective has everything to do with your mental model. With a narrow point of view, progress is slow and the Imp is strong. But if you understand how your mental model evolves, and which stage it's in, you can make sure you're doing the right things to grow.




What didn't work: memory tricks
When nothing would stick, I reached for memory techniques. I turned JavaScript into fun, exaggerated pictures. An array became an A-ray: a wizard's table of fruit and gem trays, labelled 0 to 3, with tools for sorting, searching, looping and filtering. I built memory palaces too.

It was fun. And it did not help one bit. I could recall my silly pictures, but JavaScript stayed as hard as ever.
What did work: taking code apart
So I went back to the drawing board. Instead of memorising facts, I started identifying the parts that make up code.

Circling each part made me investigate it. What does function actually create? Where does num come from? When does i++ run? And then I started noticing relationships between the parts.

The deeper I went, the more questions I asked. I filled course notes and hand-drawn diagrams, mostly circles and squares, built silly projects and read books. Visualising those parts and their links built a consolidated understanding, and everything began to click.
That was the start of The Great Sync. Over time, those circles and squares grew into a three-dimensional universe that maps JavaScript concepts into a visual form I could understand, have fun with and, ultimately, remember ๐ง .

Not an analogy, a model
Here's the key difference from my A-ray. The Great Sync doesn't memorise facts about JavaScript. It visualises how JavaScript behaves.
Take a simple function call:
function greet(language) {
if (language === 'spanish') return 'Hola!';
return 'Hello!';
}
greet('spanish');Most courses focus on what this function does: it returns a greeting. The model shows how it behaves. Calling greet is an invocation. 'spanish' travels in as an argument. A brand new execution context is created, with its own local scope. The code runs, and the return value pours back out to where the function was called.

Every concept is one layer of a much bigger picture, and each new layer connects to the ones before it. This is the model the free chapters of Imagine JavaScript build, layer by layer.
The visual approach is a bridge between technical knowledge and abstract thinking. Once you understand a pattern deeply, you remember it without any mnemonic. After a while, you won't need to imagine anymore.
If you'd like the longer story, I talked about it on the CodeNewbie podcast (the show ended in 2024, but the archive is still there) and wrote about it for Smashing Magazine.
4 things you can do to grow your model
The Great Sync isn't the only way to gain a new perspective. Any time you learn something new, your job is to look for experiences that build on it. Here are 4 things I suggest.
1๏ธโฃ Ask questions and play in code playgrounds
Be your own JavaScript detective ๐ต๏ธ. Take the code you've just seen in a tutorial and poke holes in it. What happens if you tweak it slightly? What are you assuming?
A code playground is anywhere you can run JavaScript and see a console. Try the Snippets tab in the Sources panel of Chrome DevTools:

Handy tip: keep a notes doc permanently open. Every time you meet some new code, spend 5 minutes listing questions about it. Then schedule an hour or two of playtime each week to answer them in a relaxed setting. If you bring an AI assistant along, ask it to quiz you, not to give you the answers.
2๏ธโฃ Listen to podcasts
Listening to code, without a screen, forces you to use your mind's eye. Beware: many podcasts focus on tools, libraries and frameworks. Look for episodes about concepts, like these:
- JavaScript Basics: Learn these concepts first from HTML All The Things
- The Beginner's Guide to understanding React from Develop Yourself
- JavaScript Closures and Scope Explained from Syntax
- A Deep Dive into Some Nooks and Crannies of JavaScript
3๏ธโฃ Talk JavaScript out loud
If you're stuck on a concept, start explaining the parts you do know. It must be out loud. Otherwise it stays in your head and is unlikely to give you a fresh perspective.
Handy tip: make flash cards. It may sound like school, but simple cards help you practise talking through questions like:
- What is an execution context?
- What's the difference between an argument and a parameter?
- What is
this?
Even writing the questions is valuable cognitive effort that helps you see things differently.
4๏ธโฃ My favourite: analogies and visual representations
Coming up with your own takes time (and the reward is SO worth it). Borrowing other people's is a faster way to gain a new perspective:
- Code Analogies
- Lydia Hallie's JavaScript Visualized series
- My roundup of visual learning resources for web developers
Step 2: Build sand castles
The second car needs fuel. Your learning journey should be littered with half-broken projects you wouldn't show your grandma: small, self-guided builds you make on your own, with no tutorial holding your hand. Like sand castles, they'll wash away, and that's the point. Step 2 shows you how to allocate the time, pick the projects and actually start: Build sand castles.
Step 3: Peg the washing
Once your sand castles work, most of the code gets left in a crumpled heap, like washing dumped on the floor. Step 3 is about tidying it up and building strong associations between everything you code, learn and get wrong, so it sticks: Peg the washing.
Actions to take right now
- Write down what you're currently learning.
- For each topic, spend 30 minutes finding resources that cover it, especially podcasts and visual explanations.
- In a notes app or notebook, write questions and thoughts about it, with code snippets you want to play with.
- Block time in your calendar for both cars, plus a weekly playtime session to immerse yourself.
Then keep going. The confusion is where it starts, not where it ends.