乐趣区

关于javascript:选择篇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

参考答案:

退出移动版