declare function javascript

JavaScript
function myFunction(var1, var2) {
  return var1 * var2;
}function addfunc(a, b) {
  return a + b;
  // standard long function
}

addfunc = (a, b) => { return a + b; }
// cleaner faster way creating functions!
function myFunction(p1, p2) {
    return p1 * p2;  
//  The function returns the product of p1 and p2
}
 A function is a reusable block of code that allows you to 
input specific values. To specify the values you need to call
the function by typing the name along with the desired values
spaced by commas.

function myFunction(value1, value2) {
	return value1 + value2;
}

myFunction(10, 5);




Now the function will return 15.
Source

Also in JavaScript: