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);
A) [{a: 1}, {a: 1}]
B) [{a: 1}]
Put your answer in the comments!
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);
A) [{a: 1}, {a: 1}]
B) [{a: 1}]
Put your answer in the comments!