Declares a function with a name and can be called before its definition (because of hoisting).

Example:

JavaScript
function greet(name) {
  return "Hello " + name;
}

console.log(greet("Manjeet"));

A function can also be assigned to a variable. In this case, it’s called a function expression.

Example:

JavaScript
const greet = function(name) {
  return "Hello " + name;
};

console.log(greet("Manjeet"));