解构赋值:ES6允许按照一定规则从数组或对象中提取值,并对变量进行赋值.说直白点,等号两边的结构相同,右边的值会赋给左边的变量. 一.数组的解构赋值: 1.基本用法 let [a, b, c] = [1, 2, 3]; console.log(a, b, c); //1,2,3 let [d, ,] = [1, 2, 3]; console.log(d); let [[e], f] = [[1], 2]; console.log(e, f); //1,2 let [g, ...h] = [1,…