摘要:
1. result.value.then function* gen(){ // var url = 'https://api.github.com/users/github'; var url = 'https//:www.baidu.com'; var result = yield fetch( 阅读全文
摘要:
1.带参数(10),需使用return。并且下一次调用next没有用了。 function* gen(x) { for (var x of [1,2,3,4,5]){ var y = yield (x + 2); return y+10; } } var g = gen(1); console.lo 阅读全文
摘要:
new 和不 new的区别: 如果 new 了函数内的 this 会指向当前这个 person 并且就算函数内部不 return 也会返回一个对象。 如果不 new 的话函数内的 this 指向的是 window。 function person(firstname,lastname,age,eye 阅读全文