Things like Math
and JSON
are somehow objects with keys, but they report as having no keys.
> Object.keys(JSON);
Array(0) []
> [...JSON]
TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
> Object.getOwnPropertySymbols(JSON);
Array(1) [Symbol(Symbol.toStringTag)]
length:1
__proto__:Array(0) [, …]
0: Symbol(Symbol.toStringTag)
My best guess is they've been designed to be non-iterable. But why? And how?