how to make a function in javascript

JavaScript
// Code by DiamondGolurk
// Defining the function

function test(arg1,arg2,arg3) {
	// Insert code here.
  	// Example code.
  	console.log(arg1 + ', ' + arg2 + ', ' + arg3)
}

// Running the function

test('abc','123','xyz');

// Output
// abc, 123, xyzfunction myFunction(p1, p2) {
    return p1 * p2;  
//  The function returns the product of p1 and p2
}
 public void SayHello(string name) 
{
    Console.WriteLine("Hello")  
}


Console.WriteLine("What is your name?")
string name = Console.ReadLine() ; 

SayHello(Adam) 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: