Skip to Content
0 likes
Install Node.js and Check It Actually Works Level: Intermediate

Install the LTS version of Node.js, check the installer's signature, and prove it works in a new terminal with node -v, npm -v and one real install. Plus the fixes for "not recognized" and the wrong version showing.

0 likes
Fix "Unexpected token in JSON" Errors Level: Intermediate

"Unexpected token in JSON" means JSON.parse got text that isn't JSON. Read the exact message, log the raw text, and match it to one of five causes. Most of the time it's an HTML error or login page.

0 likes
map, filter, reduce on a Real List of Orders Level: Intermediate

Five questions a manager would ask about a list of orders, each answered with map, filter, reduce or a plain loop. Real data includes an empty order, and the code has to survive it.

0 likes
npm install vs npm ci: Same Install on Every Machine Level: Intermediate

Use npm ci to install exactly what the lock file says and npm install to change it. What each command does, when to use which, and how to fix "npm ci can only install packages when your package.json and package-lock.json are in sync".

0 likes
Your First Test With Vitest Level: Intermediate

Add Vitest to a project you already have and get real tests passing: a pure function with it.each, then an async function that calls fetch, tested with a fake instead of the network.

0 likes
Closures for Private State: A Counter You Can't Break Level: Advanced

Keep a counter's value in a closure so nothing outside can set it to -5 or "abc". The pattern, how it compares with a class with

0 likes
Fix a Bound Event Listener That Will Not Detach Level: Advanced

Trace a wrong callback receiver, bind one stable listener, and verify start, stop and restart without duplicate or stale subscriptions.

0 likes
Predict the Output: Event Loop Order in 6 Snippets Level: Advanced

Six short snippets with setTimeout, promises, await and queueMicrotask. Predict the order, run it, then read why. The one rule: sync code first, then all microtasks, then the next task.

0 likes
Batch API Calls With Promise.allSettled Level: Advanced

Send many requests, keep the successes, and report the failures instead of losing everything to one rejected promise. Plus limiting how many run at once.

0 likes
Add a Timeout to fetch With AbortController Level: Advanced

fetch has no timeout option and can wait a very long time. AbortSignal.timeout(ms) fixes that in one line, and AbortSignal.any combines it with a cancel button.

0 likes
Paginate an API With an Async Generator Level: Advanced

Hide page numbers and "next" links inside an async generator, then loop over every record with for await. Stop early and the remaining pages are never fetched.

0 likes
Process a Large CSV in Node.js With Streams Level: Advanced

Read a CSV too big for memory line by line with readline, total a column, and write a filtered copy with pipeline. Memory stays flat no matter how big the file is.