Scriptdrill

Write JavaScript that passes the tests you cannot see.

Scriptdrill is JavaScript practice in your browser. Every exercise gives you a function name, its signature and example calls with the results they should return. You write the function, press Run, and it is checked against the examples and a set of hidden tests with the edge cases you did not think of.

  • Arrays: filter, map, reduce, groupBy and uniqueBy
  • Objects: pick, merge, deep get and deep equality
  • Strings: slugs, truncation, money and query strings
  • Dates in UTC, durations and month ends
  • Data shaping: CSV parsing, pivots, joins, top N
  • Async: retry, concurrency limits, debounce, timeouts

45 exercises5 levels5 free, no sign-up

Code blocks and test results arranged on a desk

Read the task, write the function, run the tests.

  1. 01
    Read the taskEvery exercise gives you the function name, its signature and calls with the results they should return.
  2. 02
    Write JavaScriptType in the editor and press Run. Your function runs in a sandboxed worker with a 3 second limit, and console.log output is shown.
  3. 03
    Pass the hidden testsSyntax errors with the line, runtime errors, wrong names, the first failing example with expected and actual values, and edge cases you did not think of.

Five levels, from your first reduce to a concurrency limit.

9BasicsSums, filter and map, includes, reversing words, capitalizing, counting vowels, clamp and range.
9Arrays and objectsgroupBy, countBy, uniqueBy, chunk, zip, flattening one level, pick, stable multi-key sorting and merging settings.
9Strings and datesSlugs, truncating with an ellipsis, money with Intl, query strings, aligned text tables, UTC date math and durations.
9Data shapingCSV text to objects, totals per customer, pivots, top N with ties, running totals, deep get by path, deep equality and left joins.
9Async and functionssleep, retry, Promise.all with a concurrency limit, debounce on a fake clock, memoize, once, pipe, timeouts and running tasks in sequence.

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.

Timed mode for real speed.Each exercise gets a clock. Hints and solutions stay locked until time is up, and your best times are kept.

Regex next.Our sister site Regexdrill drills regular expressions with live highlighting and hidden test strings, in the same JavaScript flavor. Try Regexdrill

Try the first five exercises free.

No sign-up needed for the first five. If it works for you, Pro unlocks all 45, and a free account saves your progress and your code across devices.

Start practicing free

Start free. Pay once you are hooked.

Free

$0
  • The first 5 exercises
  • Example and hidden tests on every run
  • Hints, reference solutions and timed mode
Start free

Pro

All 45
  • Objects, dates, data shaping and async patterns
  • Reference solutions with explanations
  • Progress and best times saved to your account

You create a free account first, so Pro is attached to it.

Monthly is charged today and then every month until you cancel, in one click from your account page. Lifetime is one payment with no renewals. Full refund within 14 days of paying.

Questions

Who is this for?

Working developers who want everyday JavaScript to come out right the first time, and learners who know the syntax and want practice that looks like real work: shaping data, handling strings and dates, and getting async code to behave.

Do I need to install anything?

No. 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.

How is my code checked?

Your function runs against the examples you can see and a set of hidden tests with edge cases: empty input, unicode text, negative numbers, ties and large inputs. Results are compared with a deep equality that understands arrays, objects, Dates and NaN, with a small tolerance for floating point where it matters.

What happens with an infinite loop?

Each run is stopped after 3 seconds and you are told the code timed out. Async exercises run on a fake clock, so a sleep of 10 seconds is checked instantly and exactly.

Is this puzzle practice?

No. There are no brain teasers or trick questions. The tasks are the small functions you actually write: grouping records, parsing query strings, formatting money and durations, retrying a failing request.

Is there a free version?

The first five exercises are free without an account. Pro unlocks the other 40 for $12 a month or $59 once.

How do I cancel the monthly plan?

Open Account and choose Cancel subscription. You keep Pro until the end of the period you paid for and are not charged again. If Pro is not for you, you get a full refund within 14 days of paying.

What if my answer is right but marked wrong?

Answers are checked on the result they produce, not on how they are written, so any correct function passes. If a check still gets it wrong, use the report link under the result. Reports are reviewed, and a check that is wrong gets fixed.