In the MDN variables section we have the following statement:
For that reason, it is recommended to always declare variables at the top of their scope (the top of global code and the top of function code) so it's clear which variables are function scoped (local) and which are resolved on the scope chain.
This excerpt says that it is always recommended to declare variables at the top of their scope because JavaScript has the variable hoisting behavior.
What are the implications of not following this recommendation? In particular, I find a code much easier to read when the declaration of your variable is performed at the time exactly prior to its first use, compared to declaring all variables at the start of a function's execution, for example.
Exemplifying:
// Declarando variável no topo de seu escopo
function(){
var a = 0, b = 0;
//some code
a = 5;
//some code
b = 10;
}
//Declarando variável próximo de sua utilização
function(){
//some code
var a = 0;
a = 5;
//some code
var b = 0;
b = 10;
}