Javascript Set convert array to set

Description

Javascript Set convert array to set

let a = [1, 2, 3, 4];
console.log(a);/*from  w w w . j a  v  a 2s . c om*/


let mySet = new Set(a)
console.log(mySet);
console.log(mySet.size);
      



PreviousNext

Related