Functions, arrays, objects, events and the request cycle carry most of the JavaScript a beginner writes. Each one is a skill rather than a fact, which means reading about it changes almost nothing and repeating it under slight pressure changes a great deal. The drills below are built around that gap.
The five that do the work
- Functions — taking an input, returning an output, and keeping the two obvious.
- Arrays — looping, filtering, mapping, and knowing which of those you actually need.
- Objects — grouping related values and reaching into them without guessing.
- Events — responding to a click, a key or a form submission, and changing the page from the handler.
- The request cycle — asking for data, waiting, and handling the case where it fails.
Notice what is missing: classes, prototypes, generators, the module system. They matter later and they are much easier once these five feel ordinary.
A drill for each, in order
Drills work because they are small enough to repeat and specific enough to fail visibly. Do each one three times on three different days, not three times in a row.
Functions: write one that takes a price and a tax rate and returns the total, then call it with five different pairs of numbers from the console. Rewrite it so it handles a missing tax rate without producing NaN. That second version is where the learning is.
Arrays: start with a list of ten names and produce three different outputs — the ones longer than five letters, the same list in capitals, and a single joined sentence. Use a loop first, then the built-in methods, and compare how each reads.
Objects: model something you know, such as a recipe with a title, a time and an array of steps. Render the title and step count into the page. Then add a second recipe and render both, which forces you to move from one object to an array of them.
Events: build a button that changes a paragraph, then a form that refuses to submit when a field is empty. Reading a value out of an input and putting it somewhere else on the page is the core motion of most interfaces.
Requests: fetch one public endpoint, print the raw response, then print one field from it. Add a loading message and an error message before you style anything. Handling the boring states is the part that separates a demo from something usable.
Space the practice out
Three short sessions beat one long one, and the gap between them is doing real work. Coming back to a half-finished drill means reconstructing what you meant, which is the same skill as reading code you did not write this morning. Keep each session to forty minutes and end it somewhere you can pick up again — mid-function is better than at a natural stopping point.
How to tell you actually know it
You know a technique when you can use it without a reference, explain it to someone in two sentences, and recognise it in code written by someone else. A useful test: close every tab, and write a function from memory that filters a list of objects by a property. If you can do that, arrays and objects are working for you. If you cannot, the gap is specific and small — go and close it.
From here the language opens outward into the document, into storage, into servers. But every one of those paths runs through the same five skills, repeated until they are boring.