There are various ways to define a function in JavaScript:
1. Function declaration / function statement
```
function hello() {
console.log(“Hello, World!”);
}
```
This is the most common way to create a JavaScript function. The ‘hello’ function is defined before it gets invoked. Thus, it can be called anywhere in your code.
1. Function expression
```
var hello = function() {
console.log(“Hello, World!”);
}
```
In this approach, an anonymous function is assigned to a variable called ‘hello’. Unlike function declarations, the function can only be called after it’s defined.
1. Arrow function (ES6 feature)
```
const hello = () => {
console.log(“Hello, World!”);
}
```
Arrow functions provide a more concise syntax for writing function expressions. They are best suited for non-method functions, and they cannot be used as constructors.
To call or invoke these functions, just write the function name followed by parentheses:
```
hello();
```