* 使用擴展運算符(...)拷貝數組。
```
// bad
const len = items.length;
const itemsCopy = [];
let i;
for (i = 0; i < len; i++) {
itemsCopy[i] = items[i];
}
// good
const itemsCopy = [...items];
```
* 使用 Array.from 方法,將類似數組的對象轉為數組。
const foo = document.querySelectorAll('.foo');
const nodes = Array.from(foo);