- A true
- B false
- C "true"
- D "false"
- Share this MCQ
Answer:
A
Share this MCQ
The Set
data type in JavaScript is a constructor that creates a new set object, which is a collection of unique values.
The add
method is used to add a new value to the set object.
The has
method is used to determine whether the set
object includes the specified value.
In this case, two values are added to the set object using the add
method.
The has
method is called on the set object, with the value 2
as the argument.
Since the set
object includes the value 2,
the has method will return true.
Share this MCQ