Near the end of 1.2.20, it is mentioned that a function declaration always must be made before a function call, however, this isn’t necessarily true.
A function expression must always be declared before a function call. But a regular function declaration can be made after a function call.
For example, this code will fail.
log();
var log = function() {
console.log("Hoisting is nuts");
};
This code will run fine.
log();
function log() {
console.log("Hoisting is nuts");
};
While this probably isn’t common, it’s helpful to know when reading others code. I only bring this up because it was definitely something that has caused me some headaches in the past. Hopefully this can be helpful to someone. 🙂