The different ways to define a function in JavaScript

So you want to create a function in JavaScript?
You. Have. Options:
1 — Declaration Function
function sum(a, b) { return a + b; }
2 — Expression Function
// Can be named:
(function sum(a, b) { return a + b; }); // Or anonymous (AVOID)…