Home / Programming MCQs / JavaScript MCQs / Question

C

Chandani • 9.65K Points
Tutor III

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
Explanation by: Chandani
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.