In somewhat reverse chronological order, (and not necessarily about JavaScript)
-
type Pointer<T> = T
is syntactically valid TypeScript.
-
Investigate: How does
Symbol.unscopables
affectdocument
being in lexical scope inside element attribute event handlers? -
Service workers can change headers because they act as client-side middleware.
-
A PHP bug:
strtotime() returning 1999-11-30 for 00-00-00 00:00:00
Status: Not a bug
There is no bug here, 00-00-00 means 2000-00-00, which is 1999-12-00, which is 1999-11-30. No bug, perfectly normal.
-
SharedArrayBuffers are again no longer supported on GitHub Pages.
-
Investigate: does JS garbage collect modules?
setInterval(() => import('./something.js?_=' + Date.now()))
-
<object>
-
The CSS spec says “Godspeed!”
It is at the time or writing undefined how percentage heights inside tables work in CSS. This specification does not try to specify what to use as the containing block for calculating percentage heights in tables. Godspeed!
-
The UK has decided that
<input type="number">
is a bad idea. -
#!
starts a comment, but only at the start of a script. So now there’s four ways of commenting in JavaScript. -
ES4 was going to have namespaces, among other cursed things. Strict mode would’ve required semicolons, yet syntax errors would be thrown at runtime when reached.
-
Is
++i++
not an error in any programming language? -
Julia
missing
is akin to NaN. -
TypeScript
infer
-
Float-to-i32 overflow is defined in JavaScript.
(2**34 + 1) | 0
produces 1 because x86’scvtsd2si
is wrapping. ARM’s double-to-i32 instruction is saturating, so it’d instead become the max integer,0x7fff_ffff
. So, ARM has an instruction specifically for emulating x86: Floating-point Javascript Convert to Signed fixed-point, rounding toward Zero. -
Object.hasOwn
-
Adding a ZWSP to a variable name makes a new, unique variable name despite appearing identical.
-
Bad web design: willreed.com
-
Recreating Python
with
statements:const { open } = require('fs') with (open('file.txt').as('file')) { console.log(file.read()) }
using a
FinalizationRegistry
to close the context manager when it gets garbage collected. -
new Poop()
andnew Poop
are different operators, andnew
with arguments takes precedence overnew
without arguments, sonew new Object()
is valid syntax.new new Function("console.log('hi')")().constructor()
-
You can use computed property names for class fields:
undefined instanceof class { static [Symbol.hasInstance] = () => this }
-
Escape sequences in variable names
-
Symbol.hasInstance
lets you override the behaviour ofB
ina instanceof B
, so a class can say everything is an instance of it, for multiple inheritance (a horrible idea). -
When using
with
, the lexical environment excludes properties enumerated inSymbol.unscopables
. -
Object.keys({ 4294967296: 0, 4294967295: 0, 4294967294: 0 })
-
MDN spotlights a furry.
other things:
- javascript commonjs-esm interop