Question 02 of 05

JavaScript Functions

Create a JavaScript program with functions that perform calculations and return values.

C++
<!DOCTYPE html>
<html>
<body>
    <script>
        function add(a, b) {
            return a + b;
        }
        function multiply(a, b) {
            return a * b;
        }
        let sum = add(5, 3);
        let product = multiply(4, 2);
        document.write("Sum: " + sum + "<br>");
        document.write("Product: " + product);
    </script>
</body>
</html>
Question 2 of 5