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> <h2>JavaScript Functions</h2> <p>Functions can be treated as values:</p> <p>x = myFunction(4,3) or x = 12</p> <p>In both cases, x becomes a number with the value of 12.</p> <p id="demo"></p> <script> function myFunction(a, b) { return a * b; } let x = myFunction(4, 3); document.getElementById("demo").innerHTML = x; </script> </body> </html>