Home »
MCQs »
JavaScript MCQs
What is the output of the following JavaScript code? | Question 21
78. What will be the output of the following JavaScript code?
<script>
document.write(Math.round(107.5))
</script>
- 107.5
- 107
- 108
- 107.00
Answer: C) 108
Explanation:
The Math.round(x) returns the value of x rounded to its nearest integer. Thus, the output would be 108.