生成器函数参数
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>生成器函数参数</title>
</head>
<body>
<div id="ad">
</div>
<div></div>
<script>
//生成器是个特殊函数
function * gen(arg) {
console.log(arg)
let one = yield '第一部分';
console.log(one);
let two = yield '第二部分';
console.log(two);
let three = yield '第三部分';
console.log(three);
}
let iterator = gen('student');
iterator.next('one arg');
iterator.next('two arg');
iterator.next('three arg');
</script>
</body>
</html>