Make sure you declare the i variable so you don't accidentally expose the global.  `var i = 0`