Map over javascript iterators