Creating a function for sum and product of two numbers

Report a typo

You're writing a program in JavaScript and you need to create a function that will take two numbers as arguments. This function needs to perform two operations using the arithmetic operators addition and multiplication. Calculate the sum and the product of the input numbers, respectively. Then return a string that displays these results in an understandable format.

Here's a part of the program, but certain parts are missing. Fill the blanks in code to complete the program.

Fill in the gaps with the relevant elements
 calculateSumAndProduct(num1, num2) {
    const sum = num1 + num2;
    const product = num1 * num2;
     "Sum: " + sum + ", Product: " + product;
}

console.log(calculateSumAndProduct(3, 7));
returnfunction

Create a free account to access the full topic