- A symbol
- B number
- C string
- D boolean
- Share this MCQ
Answer:
A
Share this MCQ
The Symbol data type in JavaScript is a primitive data type that represents a unique identifier.
Symbols are created using the Symbol constructor, which takes an optional string description as an argument.
In this case, a new symbol is created using the Symbol constructor, with the string "foo" as the description.
The typeof
operator is called on the symbol, which returns the string "symbol".
Share this MCQ