mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +08:00
Represent ordinary JavaScript arrays with hole, value, and explicit-undefined states; add sparse side storage and carry missing values through the frontend, native backends, runtime, and Node-facing consumers.
8 lines
305 B
TypeScript
8 lines
305 B
TypeScript
// Noncanonical numeric keys are ordinary properties and can carry present undefined.
|
|
const values: number[] = [7];
|
|
const missing = values[9];
|
|
values[-1] = missing;
|
|
values[0.5] = missing;
|
|
values[4294967295] = missing;
|
|
console.log("properties", values.length, values[-1], values[0.5], values[4294967295]);
|