const set = new Set();
set.add(1);
set.add("Lydia");
set.add({name: "Lydia"});
for (let item of set) {console.log(item + 2);
}
A: 3, NaN, NaN
B: 3, 7, NaN
C: 3, Lydia2, [Object object]2
D: "12", Lydia2, [Object object]2
参考答案:
const set = new Set();
set.add(1);
set.add("Lydia");
set.add({name: "Lydia"});
for (let item of set) {console.log(item + 2);
}
A: 3, NaN, NaN
B: 3, 7, NaN
C: 3, Lydia2, [Object object]2
D: "12", Lydia2, [Object object]2
参考答案: