Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Add Parameters to a Function</title> </head> <body> <script> // Defining function function displaySum(num1, num2) { var total = num1 + num2; document.write(total); } // Calling function displaySum(6, 20); // Prints: 26 document.write("<br>"); displaySum(-5, 17); // Prints: 12 </script> </body> </html>