mdoTomofumi Chiba
11/23/2023, 2:33:15 AM

TypeScript: 配列から要素の型を取得する

const MyArray = [
    { name: "Alice", age: 15 },
    { name: "Bob", age: 23 },
    { name: "Eve", age: 38 }
];

type T = (typeof MyArray)[number];
TweetLike