Put the var inside the for loop in javascript.  Wonders never cease.
Next javascript will have generators and list comprehensions and
destucturing and continuations.  And "for ... of".