|
@@ -0,0 +1,47 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="en">
|
|
|
+<head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
+ <title>Document</title>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+ <script>
|
|
|
+ // function* foo(){
|
|
|
+ // console.log('start');
|
|
|
+ // yield;
|
|
|
+ // console.log("1");
|
|
|
+ // yield;
|
|
|
+ // console.log("2");
|
|
|
+ // }
|
|
|
+ // let g = foo();
|
|
|
+ // g.next();
|
|
|
+ // g.next();
|
|
|
+ // g.next();
|
|
|
+
|
|
|
+ // function* foo(){
|
|
|
+ // let a = 1;
|
|
|
+ // let b = yield a + 3;
|
|
|
+ // console.log(111);
|
|
|
+ // console.log(b);
|
|
|
+ // }
|
|
|
+ // let g = foo();
|
|
|
+ // let {value} =g.next();
|
|
|
+ // console.log(g.next(value));
|
|
|
+
|
|
|
+ // function* foo(x) {
|
|
|
+ // var y = 2 * (yield (x + 1));
|
|
|
+ // console.log(y);
|
|
|
+ // var z = yield (y / 3);
|
|
|
+ // return (x + y + z);
|
|
|
+ // }
|
|
|
+ // let foo2 = foo(1);
|
|
|
+ // console.log(foo2.next());
|
|
|
+ // console.log(foo2.next(3));
|
|
|
+ // console.log(foo2.next(1));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </script>
|
|
|
+</body>
|
|
|
+</html>
|