The section “Hoisting” does a good job of explaining the ins and outs of hoisting, but states no rule about that.
For example I consider this a bad practice, because it leads to confusion and possible bugs:
function example() {
superPower(); // => Flying
function superPower() {
console.log('Flying');
}
}
The section “Hoisting” does a good job of explaining the ins and outs of hoisting, but states no rule about that.
For example I consider this a bad practice, because it leads to confusion and possible bugs: