JS function with multiple parameters
by danielkwood
HTML
<html>
<head>
<title>Functions</title>
<script src="script.js"></script>
</head>
<body>
</body>
</html>
JavaScript
// This function has three parameters (separated by commmas)
function average(num1, num2, num3){
var result = (num1 + num2 + num3) / 3;
console.log(result);
}
// Three arguments are provided for the parameters
average(10, 15, 12);