πŸ“Š JavaScript
Q. What will be the output of the following code snippet?
Code:
const set = new Set();
set.add(5);
set.add('Hello');
set.add({ name: 'Scaler' });
for (let item of set) {
 console.log(item + 6);
}
  • (A) 11 NaN NaN
  • (B) 11 NaN [object Object]
  • (C) 11 Hello6 [object Object]6
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) 11 Hello6 [object Object]6

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
230
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Admin
Publisher
πŸ“ˆ
83%
Success Rate