特牛生活网

08_数组和元组!!!_数组和元组之间的长啥样-CSDN博客

网友收藏
文章浏览阅读133次。数组和元组数组type alias 类型别名元组 tuple元组的嵌套数组const arr: (number | string)[] = [1, "2", 3];const stringArr: string[] = ["a", "b", "c"];const undefinedArr: undefined[] = [undefined];type alias 类型别名// 使用 type 关键字,定义一个 User 类型type User = { name: string; age: n_数组和元组之间的长啥样