A

Admin • 833K Points
Coach

Q. What will be the output of the following JavaScript code?

Code:
<p id="demo"></p>
<script>
var js = 10;
js *= 5;
document.getElementById("demo").innerHTML = js;
</script>
  • (A) 10
  • (B) 50
  • (C) 5
  • (D) Error
  • Correct Answer - Option(B)
  • Views: 23
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin

The *= operator in javascript is a shorthand expression for the multiplication of a particular number. It is a combination of two operators * and = .

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.