「JavaScript」Array.from()メソッドでSet からの配列の生成サンプル

書式
Array.from(配列名)
使用例

const setA = new Set(['A001', 'B002', 'C003', 'D004']);
console.log(Array.from(setA))

const setB = new Set(['111', '222', '333']);
Array.from(setB);
console.log(Array.from(setB))

実行結果
> Array [“A001", “B002", “C003", “D004"]
> Array [“111", “222", “333", “444"]

JavaScript

Posted by arkgame