0 votes
in JavaScript by

Which one of the following is correct output for the following given JavaScript code:

<p id="demo"></p>  

<script>  

functionourFunction()  

{  

document.getElementById("demo").innerHTML=Math.abs(-7.25);  

}  

</script>  

a) 7

b) -7.25

c) 25

d) -7

1 Answer

0 votes
by

Answer: C

Reason: In the following code, the method "abs ()" is used which returns absolute numbers as output hence the correct option is c. In JavaScript, the "abs ()" method is one of the methods stored in the library called Math's.

Related questions

0 votes
asked Mar 21, 2021 in JavaScript by rajeshsharma
0 votes
asked Mar 20, 2021 in JavaScript by sharadyadav1986
...