There is.
Since in JavaScript variables are function-scoped, in first case variable will exist only inside anonymous function, declared in iterator, and will be allocated on each run, each time it will be a new variable.
In second case function is bounded to some outer scope, and it will be exactly the same variable on each iteration, preserving value, stored on previous execution
Words "allocated on each iteration" can sound frightening, but basically it's not a problem, JS engines like V8 can easily perform optimisation, which will reduce overhead to 0. I'd say it's a recommended way of declaring variables - bound them to the tightest reasonable scope.
Speaking about second case - since no things would be broken, it's generally a bad design practice since some garbage old-stored value can leak to some other context, variable can be caught by some unexpected closure on continuation, etc.. Use local variables as really local.