Javascript examples for Function:Function Return
Convert Fahrenheit to Celsius:
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> function toCelcius(f) {/* w w w . j ava2 s . c o m*/ return (5/9) * (f-32); } document.getElementById("demo").innerHTML = toCelcius(32); </script> </body> </html>