const array = ['a', 'b', 'c'];type ArrayType = typeof array; // string[];type ItemType = ArrayType[number]; // string// 简写type NextItemType = (typeof array)[number];
const array = ['a', '1', true];
type ItemType = (typeof array)[number]; // string | number | boolean
type ItemTypeString = (typeof array)[0]; // string
