Open sanlangguo opened 2 years ago
JS const data = [{ name: '三郎过', age: 29, books: null }] TS interface JsonValue { [x: string]: string | number | null } const data: JsonValue[] = [{ name: '三郎过', age: 29, books: null }]
JS const obj = { name: '三郎过', t: { age: 29, books: null } } TS const obj: Record<string, any> = { name: '三郎过', t: [{ age: 29, books: null }] }
TS 常用类型
数组对象
对象子属性是数组