The output will be `undefined, 5`. This demonstrates how variable hoisting works within a function scope. When the `example()` function is called, during the creation phase, the variable declaration `var a;` is hoisted to the top of the function, but the initialization `a = 5;` stays in its original position. So the code effectively runs as:
```javascript
function example() {
var a; // a is declared but not yet initialized (value is undefined)
console.log(a); // logs undefined
a = 5; // a is assigned the value 5
console.log(a); // logs 5
}
```
This example illustrates how hoisting affects variable behavior within function scopes, not just at the global level. Each function creates its own execution context with its own variable environment, and hoisting occurs independently within each function scope. This behavior is consistent for all `var` declarations, regardless of the containing scope.