// what's hoisted
// var carName (just the variable name is hoisted)
// driveCar (whole function is hoisted because driveCar is a function declaration)
// var parkCar (just the variable name is hoisted because parkCar is a function expression)
console.log(carName);
// -> undefined
driveCar(carName);
// -> driving undefined
parkCar(carName);
// -> TypeError: undefined is not a function 


var carName = "volvo";

// function declaration
function driveCar(carName){
  console.log('driving ' + carName);
}

// function expression
var parkCar = function(carName){
  console.log('parking ' + carName);
};