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>
  1. 110
  2. 150
  3. TypeError
  4. 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.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.