how to use function in javascript

JavaScript
function idk() {
	alert('This is an alert!')
}
//call the function to make the function run by saying "Name of function + ()"
idk()/* Declare function */
function myFunc(param) {
  // Statements 
}
Source

Also in JavaScript: