Return the value of PI from a function - Javascript Function

Javascript examples for Function:Function Return

Description

Return the value of PI from a function

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<script>
function myFunction() {/*from   w w w .ja v a  2s .co m*/
    return Math.PI;
}

document.getElementById("demo").innerHTML = myFunction();
</script>

</body>
</html>

Related Tutorials