对象解构
/*
* @Author: [jsh]
* @Date: 2021-09-26 17:26:39
* @LastEditors: [jsh]
* @LastEditTime: 2021-09-26 20:03:53
* @Description:
*/
let arr=Array.of(10,'hello')
console.log(arr) //[ 10, 'hello' ]
// 经典面试题:
const [a, b, c, ...d] = [1, 2, 3, 11, 999];
const { e, f,f1, g, ...h } = { f: 4, g: 5, i: 6, j: 7 };
console.log(a, b, c, d, e, f1, g, h);
// 1 2 3 [ 11, 999 ] undefined undefined 5 { i: 6, j: 7 }