选择篇(002)-下面代码的输出是什么?

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

参考答案:

posted @ 2021-12-13 14:14  手掌日月摘星辰  阅读(27)  评论(0编辑  收藏  举报