Scriptdrill

All 45 JavaScript exercises

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. The exercises are listed here level by level. 5 are free without an account; Pro unlocks the rest.

Start practicing free

Level 1: Basics

Sums, filter and map, includes, reversing words, capitalizing, counting vowels, clamp and range.

  1. Total of a listFree
  2. Items in stockFree
  3. Full namesFree
  4. Has every tagFree
  5. Reverse the wordsFree
  6. Capitalize each wordPro
  7. Count the vowelsPro
  8. Clamp a numberPro
  9. Range of numbersPro

Level 2: Arrays and objects

groupBy, countBy, uniqueBy, chunk, zip, flattening one level, pick, stable multi-key sorting and merging settings.

  1. Group by a fieldPro
  2. Count by a fieldPro
  3. Remove duplicates by a fieldPro
  4. Split into chunksPro
  5. Zip two arraysPro
  6. Flatten one levelPro
  7. Pick some keysPro
  8. Sort by several keysPro
  9. Merge settingsPro

Level 3: Strings and dates

Slugs, truncating with an ellipsis, money with Intl, query strings, aligned text tables, UTC date math and durations.

  1. Make a URL slugPro
  2. Truncate with an ellipsisPro
  3. Format moneyPro
  4. Parse a query stringPro
  5. Align a text tablePro
  6. Add days to a datePro
  7. Days between two datesPro
  8. Format a durationPro
  9. Last day of the monthPro

Level 4: Data shaping

CSV text to objects, totals per customer, pivots, top N with ties, running totals, deep get by path, deep equality and left joins.

  1. CSV text to objectsPro
  2. Totals per customerPro
  3. Pivot rows into a lookupPro
  4. Top N with tiesPro
  5. Running totalsPro
  6. Read a nested value by pathPro
  7. Deep equalityPro
  8. Flatten a nested objectPro
  9. Left join two listsPro

Level 5: Async and functions

sleep, retry, Promise.all with a concurrency limit, debounce on a fake clock, memoize, once, pipe, timeouts and running tasks in sequence.

  1. Sleep with a PromisePro
  2. Retry a failing callPro
  3. Promise.all with a concurrency limitPro
  4. DebouncePro
  5. MemoizePro
  6. Run only oncePro
  7. Pipe functions togetherPro
  8. Timeout wrapperPro
  9. Run tasks in sequencePro

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