What will be the output of the following JavaScript code? [code] <p id="demo"></p> <script> function myFunction() { document.getElementById

Lê Như Ý

New member
What will be the output of the following JavaScript code?
Code:
<p id="demo"></p>
<script>
function myFunction() 
{
    document.getElementById("demo").innerHTML = Math.acos(0.5);
}
</script>
A. 1.01
B. 1.047
C. 1.00
D. 1.4
 
Answer: b
Explanation: The acos() method returns the arccosine of a number as a value value between 0 and PI radians. If the parameter x is outside the range -1 to 1, the method will return NaN.
 

Tìm kiếm

Back
Top