Multiple function parameters in JavaScript

A function can take not single parameter, but several. In this case, they must be listed separated by commas. For example, let's make a function that takes two numbers as parameters and prints their sum to the console:

function func(num1, num2) { console.log(num1 + num2); }

Let's test our function:

func(1, 2); // shows 3

Make a function that takes 3 numbers as parameters and prints the sum of these numbers to the console.