Javascript Set convert to Array

Description

Javascript Set convert to Array

let mySet = new Set();

mySet.add(1);//from w  ww .  j  a  v a2 s  . c  o  m
mySet.add(5);
mySet.add(5);


let myArr = Array.from(mySet);
console.log(mySet);
console.log(myArr);



PreviousNext

Related