Home »
MCQs »
JavaScript MCQs
What is the output of the following JavaScript code? | Question 5
36. 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: B) 150
Explanation:
The output of the above statement will be 150.
In the above code, the expression is (10 + 20) * 5. The precedence of () are higher than any other operators This (10 + 20) will evaluate first.