Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Functions</h1> <p>Call a function which performs a calculation and returns the result:</p> <p id="demo"></p> <script> function myFunction(p1, p2) { return p1 * p2; } let result = myFunction(4, 3); document.getElementById("demo").innerHTML = result; </script> </body> </html>