Tutorials
Practical tutorials for the work we actually do. Pick one, read it in order, and apply it.
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.
"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.
Five questions a manager would ask about a list of orders, each answered with map, filter, reduce or a plain loop.
Use npm ci to install exactly what the lock file says and npm install to change it.
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.
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
Trace a wrong callback receiver, bind one stable listener, and verify start, stop and restart without duplicate or stale subscriptions.
Six short snippets with setTimeout, promises, await and queueMicrotask. Predict the order, run it, then read why.
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.
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.
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.
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.