Theme
Primary Color
Lesson 20

Set vs Array

محتوى الدرس

main.js
/*
  Set: new Set(Iterable)
*/

let myArray = [1, 2, 3, 3, 4, 4, 2];
let myBooks = new Set(myArray);

console.log(myBooks);
console.log([...myBooks]);