(option===undefined);//true,true,true,true,true
}
数组索引
数组元素的数量保存在length属性中,通过修改length可以从数组末尾删除/添加元素
let...()返回数组元素的迭代器
console.log(Array.from(colors.values()));//["red", "blue", "green"]
//entries()返回索引/值对对迭代器...(0);//重置
//与fill()不同,copyWithin()会按照指定范围浅复制数组中的部分内容,然后插入到指定索引开始的位置
let ints, reset=()=>ints=[1,2,3,4,5,6,7...];
reset();
console.log(ints.copyWithin(2, 0));//从ints中复制索引0开始的内容,插入到索引2开始的位置, [1, 2, 1, 2, 3, 4, 5]...reset();
console.log(ints.copyWithin(2, 0, 3));//从ints中复制 索引0开始到3结束 的内容,插入到索引2开始的位置, [1, 2, 1, 2, 3,