JavaScript Quiz Question #2: A Set of Objects

Nick Scialli (he/him) - Apr 22 '20 - - Dev Community

Consider the following Set of objects spread into a new array. What gets logged?

const mySet = new Set([{ a: 1 }, { a: 1 }]);
const result = [...mySet];
console.log(result);
Enter fullscreen mode Exit fullscreen mode

A) [{a: 1}, {a: 1}]
B) [{a: 1}]

Put your answer in the comments!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player