hoisted(); // logs "foo"
function hoisted() {
console.log('foo');
}
Function expressions - anonymous functions are not hoisted:notHoisted(); // TypeError: notHoisted is not a function
var notHoisted = function() {
console.log('bar');
};