Home »
MCQs »
JavaScript MCQs
What is the output of the following JavaScript code? | Question 4
35. What will be the output of the following JavaScript code?
<script>
var x = 10 + 20 * 5;
document.getElementById("tes").innerHTML = x;
</script>
- 110
- 150
- TypeError
- ValueError
Answer: A) 110
Explanation:
The output of the above statement will be 110.
In the above code, the expression is 10 + 20 * 5. The precedence of multiplication operator (*) is higher than the addition operator (+). This 20 *5 will evaluate first.