1

我在笔中使用这行代码。

const CELLS = ([...Array(9).keys()]).map(key => '#cell' + key)

如果只是在控制台中使用它,它会 ["#cell0", "#cell1", "#cell2", "#cell3", "#cell4", "#cell5", "#cell6", "#cell7", "#cell8"]按预期创建 。但是当我打开 Babel 时,我得到了这个:["#cell[object Array Iterator]"] 但是为什么呢?

CodePen 链接

4

0 回答 0