# 数组
# 数组解构
let x: number;
let y: number;
let z: number;
let five_array = [0, 1, 2, 3, 4];
[x, y, z]...= five_array;
console.log(x, y, z); // 0 1 2
# 数组展开运算符
let two_array = [0, 1];
let five_array = [......two_array, 2, 3, 4];
console.log(five_array); // [0, 1, 2, 3, 4]
# 数组遍历
let colors: string[] = ["...red", "green", "blue"];
for (let color of colors) {
console.log(color);
}
# 对象
# 对象解构
let person...= {
name: "Cell",
gender: 'Male',
};
let { name, gender } = person;
# 对象展开运算符
let person = {