Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Statements</h1>
<h2>The function Statement</h2>
<p>Functions can be used as variables:</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
"The temperature is " + toCelsius(32) + " Centigrade";
function toCelsius(fahrenheit) {
  return (5/9) * (fahrenheit-32);
} 
</script>
</body>
</html>