What will be the output of the following JavaScript code?
Code:
<p id="demo"></p>
<script>
function myFunction()
{
var num = 5.56789;
var n = num.toExponential();
document.getElementById("demo").innerHTML = n;
}
</script>
Answer: a
Explanation: The toExponential() method converts a number into an exponential notation. It displays the number of digit according to the input passed to it.