JavaScript Program to Create a JavaScript Function to Add Two Numbers

Write a JavaScript program to create a function called sum() to add two numbers.

Source Code
    <title>Function to calculate sum of two numbers</title>
    function sum(val1, val2) 
        var result = val1 + val2;
        document.write(result + "<br/>");
    sum(23, 19);
    sum(32, 56);
    sum(12, 52);

"Coding Hub - Learn to code" app now available on Google Play Store