User:Kalpana D. Bandebuche/sandbox

JavaScript Functions

This example calls a function which performs a calculation, and returns the result:

function myFunction(p1, p2) { return p1 * p2; } document.getElementById("demo").innerHTML = myFunction(4, 3);