// 基础语法 const repos = [ {name:'grit'}, {name:'js'}, {name:'php'} ] function* loop(arr){ console.log(arr) for(const repo of arr){ yield repo } } const colors = loop(repos); // 控制台打印 colors.next()
😘