- A number
- B string
- C boolean
- D undefined
- Share this MCQ
Answer:
B
Share this MCQ
In JavaScript, variables are dynamically-typed, which means that their type can change at runtime.
In this case, the variable num
is initially assigned the value 10
, which is a number.
However, on the second line, num
is assigned the value "Hello"
, which is a string.
Therefore, the typeof
operator will return "string"
when it is called on num
.
Share this MCQ