v Functions - Javascript

Functions

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

<script>
    // Create a function with two parameters, x and y
    function multiply(x, y) {
        // Return x multipled to y
        return x * y;
    }

    // Call the function and insert the output inside the HTML element with ID="demo"
    document.getElementById("demo").innerHTML = multiply(4, 3);
</script>