0 votes
in JavaScript by

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

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

<script>  

functionmyFunction()  

{  

document.getElementById("demo").innerHTML=Math.acos(0.5);  

}  

</script>  

a) 01

b) 4

c) 00

d) 047

1 Answer

0 votes
by

Answer: D

Reason: The method "acos()" used in the above code returns the arccosine of any number passed in it as an argument. The returned value lies in between 0 and PI radians if the passed value exceeds the limit from -1 to 1, the "acos()" methods returns the NaN(also known as Not a Number).

...