A horrifying `globalThis` polyfill in universal JavaScript
Explores the surprising complexity of creating a robust `globalThis` polyfill that works across all JavaScript environments and strictness modes.
Mathias Bynens, a Chrome engineer at Google, explores JavaScript, HTML, CSS, Unicode, performance, and security, sharing deep insights into engine internals and web development best practices.
48 articles from this blog
Explores the surprising complexity of creating a robust `globalThis` polyfill that works across all JavaScript environments and strictness modes.
Explains how JavaScript engines optimize prototype property access, covering trade-offs between interpreters and optimizing compilers like V8's Ignition and TurboFan.
Explains how JavaScript engines optimize code using shapes, inline caches, and the interpreter/compiler pipeline.
Overview of new and upcoming ECMAScript regular expression features like dotAll mode, lookbehind assertions, named capture groups, and Unicode property escapes.
Explains how to use Unicode property escapes (\p{...}) in JavaScript regexes, a feature added in ES2018, for matching characters by script, category, or properties like emoji.
Clarifies the common misconception that ES2015 `const` creates immutable values, explaining it only prevents variable rebinding.
Explains the updated rules for valid JavaScript variable names in ES2015, including Unicode support and reserved words.
Explains the new Unicode 'u' flag in ES2015 JavaScript regex, covering syntax, dot operator, quantifiers, and character class behavior.
Gmail's plain text mode adds hard line breaks, causing formatting issues. The article explains the problem and a standards-compliant solution.
Explains how and why two different strings produce the same PBKDF2-HMAC-SHA1 hash, detailing the cryptographic property behind the collision.
Explains JavaScript's surprising Unicode handling, common pain points, and how ECMAScript 6 improves the situation.
Explains how to process Content Security Policy violation reports with a practical PHP script example.
Explains how to pass server-generated JSON data to the front-end when Content Security Policy (CSP) blocks inline scripts, comparing performance impacts.
Explains how to use `xhr.responseType='json'` to simplify fetching and parsing JSON data via Ajax in web development.
A comprehensive list of reserved keywords in JavaScript, detailing their evolution across different ECMAScript versions and usage rules.
Explains why MySQL's 'utf8' charset is incomplete and how to use 'utf8mb4' for full Unicode support, including emojis.
A technical guide to quickly complete Dropbox's 2012 Dropquest puzzle challenge using URL manipulation and JavaScript debugging to earn extra storage.
Explains the rules for quoting font family names in CSS, clarifying when quotes are required and when unquoted names are valid.
Explores the rules for valid, unquoted property names in JavaScript objects, including identifiers, string literals, and numeric literals.
Explains the rules for valid JavaScript variable names in ES5, including Unicode characters and reserved words.