Understand the two primary ways to create functions and the concept of hoisting.
In JavaScript, there are two main ways to create a function: as a function declaration or a function expression. A function declaration is the classic way, using the `function` keyword followed by the function name, parameters, and the function body. A key characteristic of function declarations is that they are 'hoisted'. This means the JavaScript engine moves the entire function declaration to the top of its containing scope before the code is executed. As a result, you can call a function declaration before it appears in the code. A function expression, on the other hand, involves creating a function and assigning it to a variable. The function can be named or anonymous. Unlike declarations, function expressions are not hoisted. If you use `var` to define it, the variable declaration (`var myFunction;`) is hoisted, but the assignment (`= function() {...}`) is not, so calling it before the assignment will result in a `TypeError`. If you use `let` or `const`, there is no hoisting at all, resulting in a `ReferenceError`. Function expressions are powerful because they can be passed as arguments to other functions (callbacks), returned from functions, and stored in data structures, treating functions as first-class citizens in the language.