Home »
MCQs »
JavaScript MCQs
What is the output of the following JavaScript code? | Question 25
82. What will be the output of the following JavaScript code?
<script>
let x = 10;
document.write(typeof x, " , ", typeof String(x));
</script>
- number , string
- number , number
- object , string
- object , object
Answer: A) number , string
Explanation:
In the above JavaScript code, we are using the String() method which is a global method to convert numbers to string. Thus, the statement typeof String(x) will return string.