JavaScript practice that checks the edge cases, not just the example
Most JavaScript practice sites show you a task and a single example, and your code passes when the example passes. Empty input, unicode text, negative numbers, ties, a list with ten thousand items: nobody checks, so nobody learns. Scriptdrill was built around one rule: the only way through an exercise is a function that also passes the tests you cannot see.
Every run executes your function against the examples you can see and a set of hidden tests with the edge cases. Results are compared with a deep equality that understands arrays, objects, Dates and NaN, with a small tolerance for floating point where it matters. The first failing test is shown with expected and actual values, and from the second failed try one hidden input is revealed. That is the difference between code that works on the demo and code that works in production.
JavaScript coding practice, right in your browser
There is nothing to install. Your code runs in your own browser, in a separate worker with no network access, so it starts instantly and nothing you type is executed on a server. Each run is stopped after 3 seconds, so an infinite loop costs you three seconds, not a frozen tab. Async exercises run on a fake clock, so a sleep of 10 seconds is checked instantly and exactly.
That makes it useful where opening a project is awkward: between meetings, on a train, or in the ten minutes before a technical screen. Progress and your last code are saved in your browser, and a free account keeps them across devices.
JavaScript exercises built in five levels
The 45 exercises are organized into levels of nine, and each level only adds one or two ideas on top of what you already know.
- Basics: total of a list, items in stock, full names, has every tag, reverse the words, capitalize each word, count the vowels, clamp a number, a range of numbers.
- Arrays and objects: group by a field, count by a field, remove duplicates by a field, split into chunks, zip two arrays, flatten one level, pick some keys, sort by several keys, merge settings.
- Strings and dates: make a URL slug, truncate with an ellipsis, format money, parse a query string, align a text table, add days to a date, days between two dates, format a duration, last day of the month.
- Data shaping: CSV text to objects, totals per customer, pivot rows into a lookup, top N with ties, running totals, read a nested value by path, deep equality, flatten a nested object, left join two lists.
- Async and functions: sleep with a Promise, retry a failing call, Promise.all with a concurrency limit, debounce, memoize, run only once, pipe functions together, a timeout wrapper, run tasks in sequence.
Within a level the exercises get harder one notch at a time. By the end of Async and functions you have written a retry with backoff, a concurrency limiter and a debounce that passes on a fake clock, not because you read about them, but because the hidden tests would not pass until you did.
Open the exercise list
JavaScript array practice: the methods you use every day
Half of everyday JavaScript is reshaping arrays of objects: group these orders by status, count them by country, drop the duplicates by id, sort by two keys without losing the original order for ties. Scriptdrill gives these their own level, because they are the functions you write at work and the ones interviewers reach for first.
Each one comes with hidden tests for the cases that break naive versions: an empty array, a key that is missing on some items, ties in the sort, a nested value that is null rather than undefined.
Async JavaScript practice without the waiting
Async code is hard to practice because real time is slow and flaky. Scriptdrill runs the async exercises on a fake clock, so a function that sleeps for ten seconds is checked instantly and exactly, a debounce is verified call by call, and a retry with backoff is tested against the precise sequence of attempts.
The level covers the patterns that show up in real codebases: retrying a failing request, limiting how many promises run at once, wrapping a call in a timeout, running tasks in sequence rather than in parallel, memoizing and running a setup function only once.
Learn JavaScript by getting it wrong first
A hint is one click away, but the reference solution opens only after your second attempt. That is on purpose. Running your code, seeing the first hidden test fail on an empty array, and fixing it yourself is the part that sticks. Copying a solution before you have tried does not.
Every exercise also explains why the reference solution is built the way it is: why the sort uses a stable comparator, why the slug normalizes unicode first, why the concurrency limiter tracks a queue rather than a counter.
JavaScript interview practice, the practical kind
Front-end and full-stack interviews increasingly skip the brain teasers and ask for the small functions you actually write: group these records, parse this query string, format this duration, retry this call. There are no trick questions here and no factorial of a cell. The tasks are the ones that come up in a code review.
Timed mode puts a clock on each exercise with hints and solutions locked until time is up, so you get used to writing under pressure. Run through the first four levels the week before an interview and the live coding round feels like one more drill.
Try a timed exercise
Why hands-on beats watching
You can watch a ten-minute video on reduce and feel like you understand it. Then you open an editor, type .reduce(( and stop. The gap between recognizing and producing is the whole problem, and the only thing that closes it is reps.
A Scriptdrill session is five to fifteen minutes of writing functions, each one slightly different from the last. Ten sessions in, the array methods, the Date arithmetic and the Promise patterns are automatic.
JavaScript exercises for learners and for working developers
If you know the syntax and want practice that looks like real work, Basics starts with the total of a list and does not assume anything beyond that. If you write JavaScript every day, skip to Data shaping or Async and functions and look for the gaps: most developers have one pattern they have always copied from a gist, and the hidden tests find it quickly.
Every exercise is independent, so you can jump to the one you need for today's problem and come back to the rest later.