错误
1 | var arr = [1,[[2,3],4],[5,6]] |
forEach函数不可异步调用
成功:forEach函数改为for循环
1 | for (var i = 0;i<length;i++) { |
语法
console.log(‘Hello’ + yield)
console.log(‘hello’ + (yield))
yield作为函数/赋值表达式的右侧
(1)foo(yield ‘a’,yield ‘b’)
(2)let input = yield
1 | var arr = [1,[[2,3],4],[5,6]] |
forEach函数不可异步调用
1 | for (var i = 0;i<length;i++) { |
console.log(‘Hello’ + yield)
console.log(‘hello’ + (yield))
yield作为函数/赋值表达式的右侧
(1)foo(yield ‘a’,yield ‘b’)
(2)let input = yield