let arr = [ ];
for (let { x = 2, y } of [{ x: 1 }, 2, { y }]) {
arr.push(x, y);
}
console.log(arr);
收起
你对象里的y都没赋值肯定要报错,{y:' '}
报告相同问题?