JavaScript
JavaScript is the language most people learn by accident — you come for a button that does something, and stay for closures, hoisting and the event loop. These articles cover the parts that actually trip people up in real code, with runnable examples rather than definitions.
Language fundamentals
- The Prefix Sum Technique Explained Summing the same kind of range over and over repeats work you've already done before. Precompute once, and every future range sum is one subtraction. Tutorial · 7 min read · September 1, 2026
- Kadane's Algorithm: Maximum Subarray Sum Explained Checking every possible subarray to find the largest sum costs O(n²). Kadane's Algorithm gets the same answer by making one smart decision per element. Tutorial · 7 min read · August 31, 2026
- Modern JavaScript Features You Should Actually Be Using Modern JavaScript is mostly a set of shortcuts that make ordinary code shorter and safer. A few of them also fix genuine bugs that older syntax made easy to write. Tutorial · 9 min read · August 14, 2026
- Optional Chaining and ??: Why || Breaks on Zero A student who scored zero shows up with full marks, and a cleared address field silently reverts to the old value. Both are the same one-character bug: using || where you needed ??. Tutorial · 10 min read · August 6, 2026
- JavaScript sort(): Why [10, 9, 1] Becomes [1, 10, 9] Sorting numbers with plain .sort() gives you an order that looks random until you realise every element was converted to a string first. And the array you sorted was modified, which is its own bug. Tutorial · 11 min read · August 6, 2026
- JavaScript Prototypes Explained: The Chain Behind class Only functions have a prototype property. Objects have a hidden link called __proto__. Confusing the two costs most beginners an hour, and costs candidates the interview. Tutorial · 11 min read · August 6, 2026
- Shallow vs Deep Copy in JavaScript: The Nested Trap You spread an object, change one nested field, and the original changes too. The copy was real, but it only went one level deep. Tutorial · 11 min read · August 6, 2026
- The JavaScript this Keyword, Finally Explained this is not decided by where a function is written. It is decided by how the function is called — which is why the same function behaves differently in two places. Tutorial · 10 min read · August 5, 2026
- JavaScript Hoisting Explained: var, let, const and Functions Nothing is physically moved to the top of the file. Understanding what actually happens explains why var returns undefined while let throws. Tutorial · 9 min read · August 5, 2026
- Spread and Rest in JavaScript: Same Syntax, Opposite Jobs The same three dots do two opposite things depending on where you write them. And the copy they make is shallower than most people assume. Tutorial · 9 min read · August 5, 2026
- JavaScript Closures Explained With Simple Examples A beginner-friendly guide to closures in JavaScript, built on lexical scope, with a counter, private variables, and the classic loop gotcha fixed by let. Tutorial · 9 min read · July 22, 2026
- JavaScript Destructuring: Arrays and Objects the Easy Way JavaScript destructuring lets you unpack arrays and objects into variables in one clean line. Here is how it works, with beginner-friendly examples. Tutorial · 9 min read · July 22, 2026
- JavaScript Arrow Functions: Syntax and When to Use Them A beginner-friendly guide to arrow function syntax, implicit returns, the single-parameter shorthand, and the this binding gotchas that trip people up. Tutorial · 9 min read · July 22, 2026
- == vs === in JavaScript: What's the Difference? == compares after converting types; === compares value and type with no conversion. See the surprising coercion cases and when to use each. Comparison · 8 min read · July 22, 2026
- Top JavaScript Array Methods Every Developer Should Know Meet the JavaScript array methods beyond map and filter — push, pop, slice, splice, indexOf, includes, find and sort — with clear examples and mutation tips. Tips & Tricks · 8 min read · July 22, 2026
Async and the event loop
- JavaScript Generators: Functions That Pause Mid-Run You call a generator function and nothing happens. No console.log, no validation, no error. That is not a bug, and understanding why unlocks lazy sequences, custom iterables and streaming APIs. Tutorial · 11 min read · August 6, 2026
- JavaScript Error Handling: try, catch and Async Traps A try/catch around code that returns a promise catches nothing. The catch block has already finished by the time the failure arrives, and the error escapes silently. Tutorial · 12 min read · August 6, 2026
- Python async/await and asyncio, Explained Properly One time.sleep() call inside an async function freezes every other task in your program. Here is what await actually does, and why async speeds up network calls but not number crunching. Tutorial · 10 min read · August 6, 2026
- Unhandled Promise Rejection in Node: Causes and Fixes One missing await turns a try/catch into decoration. The block completes, the promise rejects a moment later, and modern Node responds by killing your server. Tutorial · 11 min read · August 6, 2026
- The JavaScript Event Loop Explained With Examples JavaScript runs on one thread and still handles thousands of things at once. The event loop is how — and it explains every async ordering puzzle you have hit. Tutorial · 10 min read · August 5, 2026
- JavaScript Promises Explained for Beginners A beginner-friendly guide to JavaScript promises: what the promise object is, its three states, how chaining works, and how it fixes callback hell. Tutorial · 9 min read · July 22, 2026
- JavaScript Fetch API Tutorial: Call APIs From the Browser A beginner-friendly guide to calling APIs from the browser with fetch: GET, POST, JSON, headers, error handling, and async/await, with working code. Tutorial · 9 min read · July 22, 2026
- JavaScript Async/Await Explained (with Promises) Callbacks, Promises, and async/await explained simply — see how await makes asynchronous JavaScript read top to bottom, with a fetch() and try/catch example. Tutorial · 9 min read · July 22, 2026
Modern syntax
- Jest vs Vitest: Which Test Runner Should You Pick Vitest runs ESM and TypeScript with zero config; Jest needs a transform for the same code. The APIs are nearly identical. Here is how to choose. Comparison · 7 min read · September 4, 2026
- ESM vs CommonJS: import, require and the type Field Adding one line to package.json can break every require in your project at once. Here is what the two module systems actually are and where they refuse to meet. Comparison · 12 min read · August 6, 2026
Debugging JavaScript
- SyntaxError: Unexpected Token and How to Locate It The line number in a SyntaxError is almost never the line with the mistake. And when the unexpected token is a less-than sign, your API returned an HTML error page. Tutorial · 11 min read · August 6, 2026
- Why Your JavaScript Says NaN (and How to Fix It) NaN is contagious — one appears and every calculation downstream becomes NaN. Finding the first one is the entire debugging task. Tutorial · 8 min read · August 6, 2026
- Maximum Call Stack Size Exceeded: Causes and Fixes A stack overflow in JavaScript. Usually a missing base case — but the React version and the accidental-recursion version are sneakier. Tutorial · 9 min read · August 6, 2026
- TypeError: Cannot Read Property of Undefined — How to Fix It The most common error in JavaScript, and the message points at the symptom rather than the cause. Here is how to find where the undefined actually came from. Tutorial · 9 min read · August 6, 2026
- What Is CORS and How to Fix the Error The request worked in Postman and fails in the browser. Nothing is broken — you are meeting a rule that only browsers enforce. Tutorial · 10 min read · August 5, 2026
More on JavaScript
- Test Doubles Explained: Mocks, Stubs, Fakes, and Spies Most developers say 'mock' for every test double. Knowing the difference between a stub, a spy, a mock, and a fake is what keeps a test suite from rotting. Tutorial · 9 min read · September 17, 2026
- Building an LRU Cache: The Hash Map Plus Doubly Linked List Trick The hash-map-plus-linked-list LRU cache is a rite of passage. Here it is built and tested, next to the shorter Map version most production code should use. Tutorial · 8 min read · September 16, 2026
- Floating-Point Precision: Why 0.1 + 0.2 Is Not 0.3 Type 0.1 + 0.2 into any language's console and you get 0.30000000000000004. It is not a bug in that language; it is a direct consequence of storing decimal fractions in binary. Tutorial · 9 min read · September 15, 2026
- Base64 Encoding Explained: What It Is and What It Is Not Base64 shows up in data URIs, JWTs, email attachments, and API responses. It is a reversible mapping from bytes to text, nothing more, and treating it as a security measure is a common mistake. Tutorial · 8 min read · September 15, 2026
- Garbage Collection Explained: How Managed Languages Free Memory You never call free() in JavaScript or Python, yet memory gets reclaimed as the program runs. Here is how the collector decides what is garbage, and why your app can still leak. Tutorial · 9 min read · September 15, 2026
- Web Components Explained: Custom Elements, Shadow DOM, and Slots Web Components let you build reusable HTML elements with encapsulated markup, styles, and behaviour using only browser APIs. Here is how the three core pieces fit together. Tutorial · 9 min read · September 14, 2026
- Bun vs Node.js: What the New Runtime Actually Changes Bun is not just a faster Node. It folds four separate tools into one binary and runs TypeScript with no build step. Here is what that means in practice. Comparison · 8 min read · September 13, 2026
- Test Coverage: How Much Is Actually Enough A real coverage report, a real untested branch, and a passing test suite that hides an actual bug at 100 percent coverage. Here's exactly how that happens. Tutorial · 9 min read · September 7, 2026
- Flaky Tests: Why They Happen and How to Actually Fix Them The same test file, run fifteen times with nothing changed, passed twice and failed thirteen times. Here's why, and the fix that made it pass fifteen for fifteen. Tutorial · 8 min read · September 7, 2026
- Mutation Testing Explained: Testing Your Tests Your tests pass and coverage is green, but would they notice if the code were actually wrong? Here's how to find out for real, not hypothetically. Tutorial · 8 min read · September 6, 2026
- Segment Trees Explained: Range Queries in Logarithmic Time Prefix sums answer range queries instantly but choke the moment the array changes. Segment trees keep both queries and updates fast at the same time. Tutorial · 8 min read · September 1, 2026
- The Monotonic Stack Pattern Explained Finding the next bigger number for every element in an array looks like it needs a nested loop. A monotonic stack answers all of them in a single pass. Tutorial · 7 min read · September 1, 2026
- Semantic Versioning Explained npm install shouldn't feel like a gamble, but caret ranges make it one if you don't know how they treat a version that starts with a zero. Tutorial · 7 min read · August 31, 2026
- Tree Shaking Explained: How Bundlers Remove Dead Code Import one function from a library and your bundle might ship the whole thing anyway. We bundled the same code four ways to show exactly when tree shaking works. Tutorial · 8 min read · August 31, 2026
- Web Workers: Running JavaScript Off the Main Thread One long loop can lock up an entire browser tab. Web Workers move that work to another thread - here is how the two threads talk, and what a worker still cannot do. Tutorial · 9 min read · August 28, 2026
- IndexedDB Basics: Storing Real Data in the Browser localStorage tops out near 5MB and only holds strings. IndexedDB stores hundreds of megabytes of structured objects - but its transaction rules catch almost everyone out at first. Tutorial · 9 min read · August 28, 2026
- Vitest Basics: Fast Testing for Vite Projects If your project uses Vite, Vitest runs tests through the same pipeline as your app - no separate Babel or ts-jest config to keep in sync. Tutorial · 8 min read · August 26, 2026
- Playwright Basics: End-to-End Testing That Actually Works Playwright drives a real browser to test your app the way a user would. Here is how to write your first test and why its auto-waiting makes tests reliable. Tutorial · 8 min read · August 26, 2026
- Supabase Basics: Firebase's Open-Source Alternative Supabase gives you a Postgres database with an instant API, auth, and realtime subscriptions. Here is how the client works and why Row Level Security is the part you cannot skip. Tutorial · 9 min read · August 26, 2026
- Astro Basics: Why Islands Architecture Ships Less JavaScript Astro renders your pages to HTML and ships JavaScript only for the specific components that need it. Here is how islands work - and the directive mistake that ships nothing at all. Tutorial · 8 min read · August 24, 2026
- Node Streams: Processing a 10 GB File on a 512 MB Server Reading a file into memory works until the file is bigger than your memory. Streams process it in pieces, and the memory difference is not subtle. Tutorial · 9 min read · August 16, 2026
- Vue for React Developers: The Same Ideas, Different Defaults If you know React, most of Vue is a translation exercise. The interesting part is the handful of places where Vue made a different decision, and why. Tutorial · 9 min read · August 15, 2026
- Svelte: The Framework That Disappears at Build Time React and Vue ship a runtime that works out what changed. Svelte works it out while compiling and ships the update instructions instead — so there is much less framework in your bundle. Tutorial · 8 min read · August 15, 2026
- Vite vs Webpack: Why Your Dev Server Got Fast Webpack bundles your entire application before showing you anything. Vite serves your source files directly and lets the browser do the assembling. That single difference explains the speed gap. Comparison · 8 min read · August 15, 2026
- ESLint and Prettier: Ending Arguments About Code Style One of these finds bugs, the other formats code, and confusing them causes most setup problems. Configured properly, they end style debates permanently. Tutorial · 8 min read · August 15, 2026
- TypeScript for JavaScript Developers: What Changes and What Does Not TypeScript is JavaScript with a compiler that reads your code before your users do. Most of what you already know still applies — you are adding a safety net, not learning a new language. Tutorial · 9 min read · August 15, 2026
- Service Workers: A Proxy That Lives in the Browser A service worker sits between your page and the network and decides what happens to every request. That is enormously useful and the reason a bad one can serve stale content for weeks. Tutorial · 9 min read · August 14, 2026
- HTML Form Validation: The Browser Already Does Most of It Most form validation JavaScript re-implements what the browser does for free, worse and less accessibly. The built-in attributes handle the common cases in one line each. Tutorial · 8 min read · August 14, 2026
- localStorage, sessionStorage and Cookies: Which One to Use Browser storage looks like three interchangeable options. They differ in lifetime, size and — most importantly — in whether JavaScript on your page can read them, which is a security question. Tutorial · 8 min read · August 14, 2026
- Nginx Basics for Developers: Reverse Proxy Explained Adding one slash to the end of proxy_pass changes the URL your backend receives. That single character is behind most of the 404s people blame on their router. Tutorial · 10 min read · August 6, 2026
- XSS Explained: Why innerHTML Is a Security Bug Paste a script tag into innerHTML and nothing happens, so people conclude it is safe. An img tag with an onerror handler tells a very different story. Tutorial · 12 min read · August 6, 2026
- CSS Variables: Scoping, Theming and Live Updates A missing custom property does not fall back to the declaration above it. It quietly wipes the whole declaration and takes the inherited value instead. Once you know why, variables stop being mysterious. Tutorial · 10 min read · August 6, 2026
- CSS Dark Mode: Toggle, Storage and No Theme Flash The white flash before your dark theme loads is not a CSS problem. It is a script timing problem, and the fix is one small blocking script in the head that most tutorials leave out. Tutorial · 10 min read · August 6, 2026
- React useRef Explained: A Ref Is Not State Change ref.current and nothing happens on screen. That is not a bug, it is the entire point of the hook, and it is what makes refs useful and dangerous. Tutorial · 10 min read · August 6, 2026
- Debounce vs Throttle: Which One Your Handler Needs Wrapping your handler in debounce and still seeing a request per keystroke? In React the usual cause is that a fresh debounced function is created on every render, so the timer never survives long enough to fire. Comparison · 11 min read · August 6, 2026
- localStorage vs sessionStorage: What Actually Differs You save a user object, read it back, and get the string [object Object]. Web Storage stores nothing but strings, and that one fact explains most of the bugs people hit with it. Comparison · 11 min read · August 6, 2026
- Map and Set in JavaScript: When They Beat Objects Use an object as a lookup table and every key becomes a string. Two different objects used as keys collapse into one entry called [object Object], and nothing warns you. Comparison · 11 min read · August 6, 2026
- 10 JavaScript Projects for Beginners That Teach Real Skills Ten projects that each teach something specific — DOM events, async data, state, storage — rather than ten variations on the same tutorial. Tips & Tricks · 12 min read · August 6, 2026
- JavaScript Interview Questions for Freshers (With Answers) The list is shorter than you think. Interviewers reuse about fifteen questions, and they are checking whether you understand the mechanism or memorised a definition. Career · 12 min read · August 6, 2026
- JavaScript DOM Manipulation for Beginners Selecting elements, changing text and styles, adding and removing nodes, and handling clicks — taught by building a small counter and a to-do widget. Tutorial · 9 min read · July 22, 2026
- How to Build a REST API with Node.js and Express A beginner-friendly, step-by-step tutorial: build a small REST API in Express with working GET, POST, PUT and DELETE routes you can run and test yourself. Tutorial · 9 min read · July 22, 2026
- let vs const vs var in JavaScript: What is the Difference? A beginner-friendly guide to the three ways to declare JavaScript variables — how scope, hoisting, and reassignment differ, plus which one to use. Comparison · 9 min read · July 22, 2026
- What is an API? A Simple Explanation for Beginners An API lets two programs talk to each other. Learn what that means with a simple waiter analogy, plus REST, JSON, status codes, and a real fetch() demo. Tutorial · 9 min read · July 22, 2026
- JavaScript map, filter & reduce Explained (with Examples) map transforms, filter selects, reduce accumulates. See clear, runnable examples of each JavaScript array method, plus chaining and the mistakes to avoid. Tutorial · 9 min read · July 22, 2026
- Python vs JavaScript: Which Should You Learn First? An honest comparison on syntax, jobs, learning curve and where each one actually runs — plus which to pick depending on what you want to build. Comparison · 8 min read · May 7, 2026
- React Hooks: 7 Mistakes That Cause Bugs Stale closures, missing dependencies and effects that fire twice — the seven hook mistakes that produce the most confusing React bugs, and the fix for each. Tutorial · 11 min read · May 7, 2026
- React Hooks Explained Simply: useState, useEffect, useRef Understand React hooks in 10 minutes with practical examples. No jargon, just code that works. Tutorial · 11 min read · May 7, 2026
- Python vs JavaScript: Which Should You Learn First? A detailed comparison of two of the most popular programming languages. We break down use cases, job market, and learning curve. Comparison · 8 min read · May 7, 2026
