es6數組之Array.from()

Array.from方法用於將兩類對象轉爲真正的數組:相似數組的對象(array-like-object)和可遍歷(iterable)的對象(包括ES6新增的數據結構Set和Map)。es6 下面是一個相似的對象,Array.from將它轉爲真正的數組。web let arrayLike = { '0': 'a', '1': 'b', '2': 'c', length: 3 } // e
相關文章
相關標籤/搜索