Update index.js

`i` was undefined