mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
8 lines
375 B
TypeScript
8 lines
375 B
TypeScript
const values = [{ name: "first", id: 1 }].slice();
|
|
const missing: { name: string; id: number }[] = [];
|
|
values.push(missing[3]);
|
|
// The array can hold undefined, so the callback ABI includes it; spreading
|
|
// that arm cannot initialize the required fields inferred by TypeScript.
|
|
const copies = values.map((value) => ({ ...value, label: "copy" }));
|
|
console.log(copies.length);
|