1const teams = [ 2 { name: "Team 1", members: ["Paul", "Lisa"] }, 3 { name: "Team 2", members: ["Laura", "Tim"] } 4]; 5 6function* getMembers(members) { 7 for (let i = 0; i < members.length; i++) { 8 yield members[i]; 9 } 10} 11 12function* getTeams(teams) { 13 for (let i = 0; i < teams.length; i++) { 14 // ✨ SOMETHING IS MISSING HERE ✨ 15 } 16} 17 18const obj = getTeams(teams); 19obj.next(); // { value: "Paul", done: false } 20obj.next(); // { value: "Lisa", done: false }
本题为“单选题”