How do you declare a function in JavaScript?

Functions can be declared with function declarations (function name() {}), function expressions (const name = function() {}), and arrow functions (const name = () => {}).

function sayHi() { console.log("Hi"); }
const sayHello = function() { console.log("Hello"); };
const greet = () => { console.log("Greetings"); };