#1: Set does not allow duplicate
const num =[1,2,2,3]
console.log(num) // [1,2,2,3]
console.log(num.length) //4
console.log(new Set(num)) // {1,2,3}
console.log([...new Set(num)]) // [1,,2,3]
.......................................................................................................................................................................................................................
#2 seal
#3 fredeze
const num =[1,2,2,3]
console.log(num) // [1,2,2,3]
console.log(num.length) //4
console.log(new Set(num)) // {1,2,3}
console.log([...new Set(num)]) // [1,,2,3]
.......................................................................................................................................................................................................................
#2 seal
#3 fredeze
No comments:
Post a Comment