What will be the output of the following JavaScript code? [code] <p id="demo"></p> <script> function myFunction() { var num = 098;

Danh Trịnh

New member
What will be the output of the following JavaScript code?
Code:
<p id="demo"></p>
<script>
function myFunction() 
{
   var num = 098;
   var n = num.valueOf()
   document.getElementById("demo").innerHTML = n;
}
</script>
A. 098
B. 98
C. Error
D. Undefined
 

Tìm kiếm

Back
Top