Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Web technologies Questions | JavaScript Course Quiz 1 | Question 45

  • Last Updated : 26 Aug, 2021

What will be the output of the following code
const arr=new set([1,2,2,3,3,4,4,4,4,5,6])
console.log(arr)

(A) [1,2,3]
(B) [1,2,3,4,5,6]
(C) [5,6]
(D) None of the above


Answer: (B)

Explanation: Set data structure is used to store only the unique values present in the input

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!