It makes a difference if for some reason (should never be the case) you've declared a global variable by the same name outside the context of the function.
http://jsfiddle.net/bFRKU/
var i = 'global';
function test(){
alert(i);
for(var i = 0; i < 10; i++){
//do something
}
}
test();
In the above example, you'll notice that the alert returns "undefined." This is because variable definitions are hoisted to the top of the function (no matter where they are declared within the function). So in reality, the above is interpreted as:
http://jsfiddle.net/bFRKU/1/
var i = 'global';
function test(){
var i;
alert(i);
for(i = 0; i < 10; i++){
//do something
}
}
test();
Thus the alert "undefined." Ultimately, the only reason to place your variable declarations at the top of your functions is to reduce this potential confusion.