
Building Efficient Recursive Functions in JavaScript
How to build efficient recursive functions in JavaScript, with better base cases, less repeated work, and a clearer sense of when recursion fits naturally.
Articles
Development is the broadest category in my writing, so it works as the main archive rather than a narrow subject label. It brings together implementation notes and technical decisions, with delivery lessons from across the rest of the site.

How to build efficient recursive functions in JavaScript, with better base cases, less repeated work, and a clearer sense of when recursion fits naturally.

Execution context defines how JavaScript code runs, from global scope to function calls. Here, I explore how it works in browsers, React, Next.js, and Node.js.

Roll out React Compiler with matched control builds, emitted‑code checks, correctness tests, and a tested rollback. Keep timing separate from compiler coverage.

useMemo and useCallbackOptimise React performance with useMemo and useCallback only where profiling shows expensive calculations, unstable functions, or avoidable re‑renders.

Resume a Node.js CMS migration after a lost reply or killed process. Reconcile stable identities, verify checkpoints, and stop before overwriting manual edits.

Solve Binary Tree Zigzag Level Order Traversal with breadth‑first search, level sizing, alternating output order, and TypeScript implementation details.

A version‑specific investigation into Next.js 15.5.5 Middleware not firing in Pages Router, with checks, workarounds and Next.js 16 Proxy context.

Compare React Activity, conditional rendering, and CSS hiding. Preserve a panel's draft, clean up subscriptions, restore focus, and keep records separate.

How ISR improves Next.js performance by mixing static speed with controlled freshness, and where it fits best over fully dynamic rendering for changing content.

Answer immutable matrix range sums in TypeScript with a padded prefix table, inclusion‑exclusion, safe row allocation, and exhaustive small‑grid tests.

Reversing an array in JavaScript can be done with .reverse(), but it mutates the original array. Here, I explore immutable methods and older techniques.

Memory leaks in React can cause sluggish performance and excessive memory usage. Here, I explore common causes, how to prevent them, and debugging techniques.

Run small TypeScript build scripts with Node's native type stripping. Keep type checking separate, pin the runtime, and test syntax and module limitations.

How to create custom Vue directives for DOM‑level behaviour, without reaching for them when a component, prop, or composable would do better in real interfaces.

Solve Binary Tree Level Order Traversal with breadth‑first search in TypeScript, using a queue, level sizing, edge cases, and cleaner iteration.

Solve Subarray Sum Equals K with prefix sums and a hash map in TypeScript, including negative numbers, count storage, and why sliding window fails.

CSS container queries let components respond to an ancestor container's size. I explain query containers, responsive components, and browser fallbacks.

Build a headless CMS‑powered Next.js site with content modelling, fetch layers, mapped front‑end data, preview support, and scalable rendering choices.