es6新特性-Set和Map數據結構

Set和Map數據結構 Set 自己是一個構造函數,用來生成 Set 數據結構。Set 結構不會添加劇復的值。 Set 函數能夠接受一個數組(或相似數組的對象)做爲參數,用來初始化。php // 例一 const set = new Set([1, 2, 3, 4, 4]); [...set] // [1, 2, 3, 4] // 例二 const items = new Set([1, 2,
相關文章
相關標籤/搜索