返回博主主页
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 27 下一页
摘要: 1. result.value.then function* gen(){ // var url = 'https://api.github.com/users/github'; var url = 'https//:www.baidu.com'; var result = yield fetch( 阅读全文
posted @ 2021-10-28 21:34 懒惰的星期六 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2021-10-28 21:06 懒惰的星期六 阅读(252) 评论(0) 推荐(0) 编辑
摘要: function* gen(x){ try { var y = yield x + 2; } catch (e){ console.log(e); console.log("进入异常catch输出"); } return y; } var g = gen(1); console.log(g.next 阅读全文
posted @ 2021-10-28 19:48 懒惰的星期六 阅读(101) 评论(0) 推荐(0) 编辑
摘要: function dad(){ this.name = "123" this.age = 33 } var dad1 = new dad() var dad2 = new dad() dad.prototype.funcd= ()=>{ console.log("funcdddddd") } //通 阅读全文
posted @ 2021-10-28 16:04 懒惰的星期六 阅读(513) 评论(0) 推荐(0) 编辑
摘要: new 和不 new的区别: 如果 new 了函数内的 this 会指向当前这个 person 并且就算函数内部不 return 也会返回一个对象。 如果不 new 的话函数内的 this 指向的是 window。 function person(firstname,lastname,age,eye 阅读全文
posted @ 2021-10-28 15:38 懒惰的星期六 阅读(564) 评论(0) 推荐(0) 编辑
摘要: 数组作为函数的返回值进行结构的时候,一些问题。 "use strict" function returnArray() { var [left, right, top, bottom] = [1, 2 ,3 ,4] console.log(left, right, top, bottom) retu 阅读全文
posted @ 2021-10-28 11:24 懒惰的星期六 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 构造函数如果采用以下这种方式声明,并不能为Point类生成一个名name为‘y1’的属性property。 Object.assign(Point.prototype, { constructor(x,y){ this.x=x; this.y1=y; }, fun1(){} }); 完整demo如下 阅读全文
posted @ 2021-10-27 14:59 懒惰的星期六 阅读(58) 评论(0) 推荐(0) 编辑
摘要: jQuery 入口函数: $(document).ready(function(){ // 执行代码 }); 或者 $(function(){ // 执行代码 }); JavaScript 入口函数: window.onload = function () { // 执行代码 } jQuery 入口 阅读全文
posted @ 2021-10-24 20:15 懒惰的星期六 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 1. this.handleClick = this.handleClick.bind(this); 点击查看代码 class Toggle extends React.Component { constructor(props) { super(props); this.state = {isTo 阅读全文
posted @ 2021-10-23 21:36 懒惰的星期六 阅读(53) 评论(0) 推荐(0) 编辑
摘要: java中的构造方法调用顺序问题,举例如下: public class Son extends Father { SonProp r = new SonProp(); public Son() { System.out.println("Son is construct"); } public st 阅读全文
posted @ 2021-10-12 17:45 懒惰的星期六 阅读(506) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 27 下一页

Welcome to here

主页