Iterator for JS