Introducing Mentoss: The fetch mockerA new approach to mocking global fetch() calls that works in both browsers and server-side runtimes.January 27, 2025• 10 min readJavaScriptOpen SourceFetch
What's the difference between JavaScript engines and JavaScript runtimes?Runtimes and engines are often incorrectly referred to as the same thing.March 26, 2024• 5 min readJavaScriptECMAScriptAPIs
Introducing humanfs (formerly fsx): A modern filesystem API for JavaScriptFilesystem APIs in JavaScript runtimes haven't been great for a long time. This is my attempt to make a better one.January 10, 2024• 11 min readJavaScriptFilesystemAPIs
JavaScript WTF: Why does every() return true for empty arrays?How can a condition be satisified when there aren't any values to test?September 8, 2023• 6 min readJavaScriptWTF
Disabling paste in textboxes is not a security featureThis common, and annoying, pattern on many government and financial websites causes more problems than it solves.July 3, 2023• 11 min readHTMLSecurityAccessibility
Automating tweets with Twitter API v2As Twitter disables many apps that use the v1.1 API, it's time to learn how to automate tweets using v2.April 18, 2023• 5 min readTwitterAPIOAuth
Creating a Jekyll-style blog post URL in AstroIt's not obvious from the examples, but you can emulate Jekyll-style blog post URLs including years and months in Astro.March 14, 2023• 6 min readJavaScriptAstroJekyll
Creating a Jekyll-style blog post year archive in AstroWhile not included in their default blog template, it is straightforward to create a year-based archive for your posts in Astro.February 14, 2023• 4 min readJavaScriptAstroJekyll
The lazy-loading property pattern in JavaScriptYou can defer computationally-expensive operations until needed using an accessor property.April 20, 2021• 6 min readJavaScriptDesign Patterns
Introducing Env: a better way to read environment variables in JavaScriptReading environment variables in JavaScript is fraught with peril. Env makes it better.February 16, 2021• 6 min readJavaScriptEnvironment VariablesNode.js
Creating a JavaScript promise from scratch, Part 7: Unhandled rejection trackingRejected promises without rejection handlers can hide important errors, which is why both Node.js and browsers have a way of tracking them.January 19, 2021• 19 min readJavaScriptPromisesECMAScript 6
Creating a JavaScript promise from scratch, Part 6: Promise.all() and Promise.allSettled()Promise.all() and Promise.allSettled() work on any number of promises to allow you to know when all of the promises have resolvedDecember 16, 2020• 11 min readJavaScriptPromisesECMAScript 6
Creating a JavaScript promise from scratch, Part 5: Promise.race() and Promise.any()Promise.race() and Promise.any() work on any number of promises to allow you to know when certain ones have resolved November 24, 2020• 19 min readJavaScriptPromisesECMAScript 6
Creating a JavaScript promise from scratch, Part 4: Promise.resolve() and Promise.reject()Promises created with Promise.resolve() and Promise.reject() go through a different process than when created with a constructor.October 13, 2020• 8 min readJavaScriptPromisesECMAScript 6
Creating a JavaScript promise from scratch, Part 3: then(), catch(), and finally()Promise handlers are where all of the asynchronous actions happens and it helps to look at the internals to understand how they work.October 6, 2020• 22 min readJavaScriptPromisesECMAScript 6
Creating a JavaScript promise from scratch, Part 2: Resolving to a promiseResolving promises to non-thenables is easy; resolving promises to other promises requires a bit of work.September 29, 2020• 7 min readJavaScriptPromisesECMAScript 6
Creating a JavaScript promise from scratch, Part 1: ConstructorSometimes it's easier to understand complex concepts like promises by creating them yourself.September 22, 2020• 14 min readJavaScriptPromisesECMAScript 6
Computer science in JavaScript: Circular Doubly-linked listsExpanding on a doubly linked list by adding circular traversal.March 5, 2019• 14 min readComputer ScienceData StructuresJavaScript
Computer science in JavaScript: Doubly linked listsImplementing a doubly linked list in JavaScript.February 5, 2019• 11 min readComputer ScienceData StructuresJavaScript
Why I've stopped exporting defaults from my JavaScript modulesAfter years of fighting with default exports, I've changed my ways.January 15, 2019• 11 min readJavaScriptModulesCommonJS
Computer science in JavaScript: Linked listBuilding the classic computer science data structure in JavaScript.January 8, 2019• 15 min readComputer ScienceJavaScriptLinked List
Extracting command line arguments from Node.js using destructuringUsing array destructuring to easily handle command line arguments.October 2, 2018• 2 min readJavaScriptDestructuringNode.js
Detecting new posts with Jekyll and NetlifyUse Node.js to tell when a new Jekyll blog post is published.September 4, 2018• 5 min readJavaScriptJekyllNetlify
The inception of ESLintThe story of how one bug at work spawned the pluggable linter.February 27, 2018• 6 min readJavaScriptESLintECMAScript
The ECMAScript 2016 change you probably don't knowHow the JavaScript strict mode directive changed in 2016.October 18, 2016• 7 min readJavaScriptECMAScript 2016Strict Mode
ES6 module loading: More complicated than you thinkModule JavaScript can be indistinguishable from non-module JavaScript.April 5, 2016• 7 min readJavaScriptECMAScript 6Modules
Mimicking npm script in Node.jsRun command line tools with specific environment settings.March 8, 2016• 4 min readJavaScriptNode.jsnpm
Reflections on ESLint's successThe little linter that could has grown up before my eyes.February 9, 2016• 13 min readJavaScriptESLintJSHint
Hidden performance implications of Object.defineProperty()November 17, 2015• 5 min readPerformanceECMAScript 5JavaScript
Creating type-safe properties with ECMAScript 6 proxiesApril 29, 2014• 4 min readECMAScript 6JavaScriptProxies
Now shipping: Principles of Object-Oriented JavaScriptFebruary 25, 2014• 5 min readBooksJavaScriptWriting
Maintainable Node.js JavaScript: Avoid process.exit()February 4, 2014• 4 min readJavaScriptMaintainableNode.js
Private instance members with weakmaps in JavaScriptJanuary 21, 2014• 6 min readECMAScript 6JavaScriptWeakMap
Understanding ECMAScript 6 arrow functionsSeptember 10, 2013• 7 min readECMAScript 6FunctionsJavaScript
On the politics, cargo-culting, and maintainability of JavaScriptMay 28, 2013• 13 min readConventionsJavaScript
Now available: Principles of Object-Oriented Programming in JavaScript (beta)December 18, 2012• 7 min readJavaScriptWriting
Computer science in JavaScript: QuicksortNovember 27, 2012• 9 min readAlgorithmsComputer ScienceJavaScript
Does JavaScript need classes?ECMAScript 6 adds classes to JavaScript. Do we really neeed them?October 16, 2012• 6 min readClassesECMAScript 6JavaScript
Computer science in JavaScript: Merge sortOctober 2, 2012• 5 min readAlgorithmsComputer ScienceJavaScript
Computer science in JavaScript: Insertion sortSeptember 17, 2012• 5 min readAlgorithmsComputer ScienceJavaScript
A critical review of ECMAScript 6 quasi-literalsAugust 1, 2012• 22 min readECMAScript 6JavaScriptQuasis
Working with files in JavaScript, Part 3: Progress events and errorsMay 22, 2012• 5 min readFile APIFileReaderFiles
Working with files in JavaScript, Part 2: FileReaderMay 15, 2012• 5 min readFile APIFileReaderJavaScript
Proposal: Scripting detection using CSS media queriesJanuary 4, 2012• 5 min readCSSJavaScriptMedia Query
Custom types (classes) using object literals in JavaScriptNovember 4, 2011• 4 min readECMAScriptHarmonyJavaScript
So you want to write JavaScript for a living? [repost]October 20, 2011• 10 min readEmploymentJavaScriptJobs
Introduction to the Page Visibility APIAugust 9, 2011• 4 min readJavaScriptPage Visibility APIPerformance
Better JavaScript animations with requestAnimationFrameMay 3, 2011• 11 min readAnimationJavaScriptmozRequestAnimationFrame
Separating JavaScript download and executionFebruary 14, 2011• 10 min readFeature DetectionJavaScriptPerformance
On UA sniffing, browser detection, and Alex's postFebruary 8, 2011• 7 min readBrowser DetectionFeature DetectionJavaScript
Introduction to Server-Sent EventsOctober 19, 2010• 4 min readEventSourceJavaScriptServer Sent Events
Why is getElementsByTagName() faster than querySelectorAll()?September 28, 2010• 5 min readgetElementsByTagNameJavaScriptNodeList
Learning from XAuth: Cross-domain localStorageSeptember 7, 2010• 10 min readCross Document MessagingiframeJavaScript
Maintainable JavaScript: Don't modify objects you don't ownMarch 2, 2010• 7 min readJavaScriptMaintainable
How Internet Explorer 8 document mode affects JavaScriptFebruary 2, 2010• 6 min readArraysInternet ExplorerJavaScript
Internet Explorer 8 document and browser modesJanuary 19, 2010• 6 min readBrowser ModeCSSDocument Mode
Feature detection is not browser detectionDecember 29, 2009• 11 min readBrowser DetectionFeature DetectionJavaScript
Computer science in JavaScript: Base64 encodingDecember 8, 2009• 18 min readBase64Computer ScienceJavaScript
The curious case of JavaScript unit testingNovember 17, 2009• 10 min readContinuous IntegrationJavaScriptRhino
Introducing Combiner, a JavaScript/CSS concatenation toolSeptember 22, 2009• 8 min readBuildCombinerJavaScript
Computer science in JavaScript: Selection sortSeptember 8, 2009• 4 min readAlgorithmsComputer ScienceJavaScript
Computer science in JavaScript: Binary searchSeptember 1, 2009• 6 min readAlgorithmsBinary SearchComputer Science
Computer science in JavaScript: Credit card number validationAugust 4, 2009• 4 min readAlgorithmsComputer ScienceJavaScript
Firefox 3.5/Firebug XMLHttpRequest and readystatechange bugJuly 9, 2009• 7 min readAjaxFirebugFirefox
Computer science in JavaScript: Binary search tree, Part 2June 16, 2009• 8 min readBinary Search TreeComputer ScienceData Structures
Computer science in JavaScript: Binary search tree, Part 1June 9, 2009• 9 min readBinary Search TreeComputer ScienceData Structures
Computer science in JavaScript: Bubble sortMay 26, 2009• 5 min readAlgorithmsComputer ScienceJavaScript
Computer science in JavaScript: Doubly-linked listsApril 21, 2009• 4 min readComputer ScienceData StructuresJavaScript
Computer science in JavaScript: Linked listApril 13, 2009• 6 min readComputer ScienceJavaScriptLinked List
First review of Professional JavaScript, 2nd EditionMarch 7, 2009• 2 min readBooksJavaScriptProfessional JavaScript
What determines that a script is long-running?January 5, 2009• 6 min readJavaScriptLong-Running ScriptRunaway Script
Now available: Professional JavaScript, Second EditionDecember 31, 2008• 7 min readBooksJavaScriptPersonal
Professional JavaScript, 2nd Edition available for pre-orderNovember 11, 2008• 2 min readBooksJavaScriptProfessional JavaScript
Falling in love with the IE8 JavaScript debuggerMarch 22, 2008• 3 min readDebuggerInternet ExplorerJavaScript
The dreaded Operation Aborted errorMarch 17, 2008• 2 min readInternet ExplorerJavaScriptOperation Aborted
Book Review: Pro JavaScript Design PatternsFebruary 24, 2008• 3 min readBooksDesign PatternsDustin Diaz
Browsers too leniant with regular expressionsNovember 28, 2007• 2 min readBrowsersJavaScriptRegular Expressions
Professional JavaScript, 2nd Edition feedback wantedJuly 15, 2007• 1 min readJavaScriptPersonalProfessional JavaScript
Feature detection != browser detectionJanuary 15, 2007• 1 min readBrowser DetectionFeature DetectionJavaScript
Browser detection versus feature detectionNovember 16, 2006• 3 min readBrowser DetectionFeature DetectionJavaScript
The case against Hungarian notation in JavaScriptNovember 1, 2006• 5 min readHungarian NotationJavaScript