
Comparing Arrays in JavaScript
Comparing arrays in JavaScript is trickier than it first looks. This guide covers reference equality, value comparison, and practical alternatives.
Articles
JavaScript is the working language behind most of my front‑end writing, from small browser behaviours to application state and asynchronous code. These articles favour the mechanism behind a feature over a clever trick, whether the subject is callbacks, async code, or a language edge that only becomes obvious in production.

Comparing arrays in JavaScript is trickier than it first looks. This guide covers reference equality, value comparison, and practical alternatives.

Write safer JavaScript for older browsers by checking support, avoiding fragile assumptions, containing failures, and keeping core interactions usable.

IIFEs were a common JavaScript pattern before modern modules took over. This guide explains what they do, why they existed, and when they still appear.

call, apply, and bind in JavaScriptUnderstand call, apply, and bind in JavaScript, including this context, borrowed methods, callbacks, partial application, and production review caveats.

Use push() and unshift() to append or prepend JavaScript array items, with simple examples and the easily missed return value of each method.

The JavaScript prototype chain underpins inheritance, enabling object property sharing. Here, I explore its workings, property searching, and quirks.

A practical overview of JavaScript build tools and module formats, covering globals, CommonJS, AMD, Browserify, bundling, and project trade‑offs.

Type coercion in JavaScript explained clearly, including implicit vs. explicit conversion, equality surprises, string concatenation, and number casting.

Use CommonJS modules in JavaScript with require() and module.exports, covering Node.js origins, browser bundling, limitations, and ES module comparison.

Controlled vs. uncontrolled components in React explained with form examples, refs, validation trade‑offs, and why each approach suits different jobs.

this Changes in JavaScript Event Handlers and MethodsUnderstand why this changes in JavaScript methods and event handlers, including call sites, arrow functions, bind(), event objects, and context bugs.
forEach and for...ofCompare classic for loops, ES5 forEach() and ES6 for...of in JavaScript, including NodeList support, readability and when a loop can stop early.

Asynchronous Module Definition explained, including AMD module loading, define(), dependency handling, CommonJS, ES modules, and modern relevance.

Keep jQuery plugin usage maintainable with clear wrappers, option defaults, event names, lifecycle checks, CSS boundaries, ownership, and update notes.

Callbacks are a core part of JavaScript, even if promises get more attention now. This guide explains how they work and where they still show up.

Primitive vs. reference types in JavaScript explained clearly, including copying behaviour, mutation, equality, and why arrays and objects surprise beginners.

Lifting state up in React explained clearly, including shared state, single sources of truth, child callbacks, and when moving state higher helps.

localhostThere are many reasons that you might want to detect whether your code is running on localhost. Aside from using environment variables, there's also JavaScript!