🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

निम्नलिखित जावास्क्रिप्ट कोड का आउटपुट क्या होगा?

What will be the output of the following JavaScript code ?

<p id="demo"></p>
<script>
var js = 10;
js *= 5;
document.getElementById("demo").innerHTML = js;
</script>

A)
B)
C)
D)

Explanation:

In the given JavaScript code:

var js = 10;
js *= 5;
document.getElementById("demo").innerHTML = js;
  • Initially, the value of js is 10.
  • The expression js *= 5; is equivalent to js = js * 5;, so it multiplies js by 5, changing its value to 50.
  • The updated value of js, which is 50, will then be displayed inside the

    element with the id "demo".

So, the correct answer is:

(D) 50.

Latest Updates