
Track Element Visibility Using Intersection Observer
A look into how we can use the Intersection Observer API in JavaScript to efficiently track element visibility and how it outperforms historical alternatives.
Articles
JavaScript is probably one of the most‑used programming languages in the world, and a cornerstone of front‑end (and more general) web development. It enables the development of interactivity and features that HTML and CSS alone simply cannot, and includes more advanced concepts like closures, callbacks, and asynchronous programming.
Below you will find a subset of articles from my blog specifically about JavaScript. This is an area I have worked with for many years, and it has been a regular subject in my writing. There are three hundred nineteen articles collected together for you below.

A look into how we can use the Intersection Observer API in JavaScript to efficiently track element visibility and how it outperforms historical alternatives.

Not all object copies in JavaScript behave the same way. Explore the difference between deep‑cloning and shallow‑cloning, when to use each, and common pitfalls.

A retrospective on React component APIs before hooks settled, covering render props, higher‑order components, context, classes, and migration judgement.

A practical guide to JavaScript iterators and generators, with lazy sequences, custom iteration, generator control flow, and the trade‑offs behind both.

Whilst replatforming an app, I came across this limitation in Next.js: you cannot (easily) access search parameters in an SSR layout. Here, I share my solution.

Flatten arrays in JavaScript with flat(), recursion, stacks, depth control, compatibility notes, and performance trade‑offs for nested data safely.

How to write effective Angular unit tests that focus on behaviour, TestBed boundaries, realistic setup, and assertions that survive refactoring over time.

Find the weekday from a JavaScript date with Date, UTC alternatives, modulo arithmetic, parsing caveats, daylight saving time, and readable day names.

instanceofUncover the differences between JavaScript's `instanceof` and `typeof` for type checking, with practical examples and insights on when to use each operator.

A practical guide to implementing authentication in Next.js with NextAuth.js, including sessions, callbacks, route protection, and router‑specific trade‑offs.

reduce() in JavaScriptUnderstand JavaScript reduce() with accumulator patterns, initial values, practical examples, readability trade‑offs, and when reduce() genuinely helps.

How to build a Progressive Web App with Angular, including service workers, caching, offline behaviour, installs, and the trade‑offs behind the defaults.

{} isn't Equal to {}In JavaScript two empty objects are not equal. One of my go‑to interviewing questions, here I offer an explanation and strategies to compare object contents.

Pure functions make JavaScript easier to test, reason about, and reuse. This guide explains what purity means and why it matters in everyday code.

The Vue 3 Composition API explained with practical TypeScript examples, refs, composables, reactivity, and when the pattern genuinely helps larger components.

Angular change detection explained through zone triggers, OnPush, signals, template cost, manual checks, and practical rendering optimisation at scale.

Why view source stopped being enough for modern web checks, and how rendered HTML, hydration, metadata, schema, crawl paths, and client output changed audits.

Validate parentheses input in TypeScript with a stack, checking bracket order, matching pairs, real parser‑style use cases, and alternative approaches.