JavaScript Quiz Question #2: A Set of Objects

nas5w

Nick Scialli (he/him)

Posted on April 22, 2020

JavaScript Quiz Question #2: A Set of Objects

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!

💖 💪 🙅 🚩
nas5w
Nick Scialli (he/him)

Posted on April 22, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related