How is that possible that code below doesn't alert undefined? From my understanding only variables names declaration were hoisted and then on createWorkout() call it's should be undefined but it's not and works perfectly fine.
var start = function() {
var workout = createWorkout();
alert(workout.name);
}
var createWorkout = function() {
var plan = {
name: "ex1"
}
return plan;
}
start();