按照阮一峰的ECMA6标准入门例子写的,运行环境为vscode"use strict"function* fibs() { let a = 0; let b = 1; while (true) { yield a;
[a, b] = [a, a+b];
}
}let [first, second, third, fourth, fifth, sixth] = fibs();console.log(sixth)运行报错,报错为[a, b] = [a, a+b];
^ReferenceError: Invalid left-hand side in assignment有知道为什么的大牛吗?
添加回答
举报
0/150
提交
取消