IndexIterator-javascript