What will be the output of the following JavaScript code?
<p id=”demo”></p>
<script>
document.getElementById(“demo”).innerHTML =
Math.sin(90 * Math.PI / 180);
</script>
a) 1
b) 0
c) 1.6
d) 0.5
Answer: a
Explanation: Math.sin function evaluates the sine value of a particular input.
Math.PI function generates a value of 3.14.
Related Posts
What will be the output of the following JavaScript code?
<p id=”demo”></p>
<script>
document.getElementById(“demo”).innerHTML = Math.sqrt(49);
</script>What will be the output of the following JavaScript code?
<p id=”demo”></p>
<script>
document.getElementById(“demo”).innerHTML = Math.floor(4.7);
</script>What will be the output of the following JavaScript code?
<p id=”demo”></p>
<script>
document.getElementById(“demo”).innerHTML = Math.min(0, 150, 30, 20, -8, -200);
</script>What will be the output of the following JavaScript code?
<p id=”demo”></p>
<script>
document.getElementById(“demo”).innerHTML = Math.abs(-4.5);
</script>The new Java arrays can be created into JavaScript programs using which of the following classes?
The JavaScript classes can be instantiated using _____ operator.
What does Rhino do when the getter and setter methods exist?
Join The Discussion