上一页 1 2 3 4 5 6 7 ··· 18 下一页
摘要: Promise 实例化后报错 const p1 = new Promise() console.log(p1) 阅读全文
posted @ 2022-03-08 21:25 小僵尸 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 只要块级作用域内存在let 、const命令;它所声明的变量就会绑定这个区域;在绑定之前就使用这个变量;会报错;存在暂时性死区 { let a = 3; { console.log(a); let a = 5 } } ReferenceError: Cannot access 'a' before 阅读全文
posted @ 2022-03-03 23:12 小僵尸 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 身边的同事都太卷了,大晚上的在群里说tag函数,🙂没有听过 熟悉了下常用的函数默认值,发现了两个新东西 😂 1.如果函数有默认值,参数是不可以同名的,同名会报错,脑残会这么传参吧😂 如下 // 不报错 function foo(x, x, y) { // ... } // 报错 functio 阅读全文
posted @ 2022-03-03 22:34 小僵尸 阅读(70) 评论(0) 推荐(0) 编辑
摘要: function instanceof1(left, right){ if(typeof right !== 'function') throw new Error('instanceof1 error') let proto = left.__proto__; while(proto){ if(p 阅读全文
posted @ 2022-03-01 15:20 小僵尸 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 使用hook时,setState每次都会返回一个新的对象,同时页面会reRender一次。 如果set多个对象的时候,会造成页面渲染多次 此时:我们优化的方案想起来的有两种 第一种:合并对象 第二种:使用ReactDom提供的 unstable_batchedUpdates unstable_bat 阅读全文
posted @ 2021-11-22 16:27 小僵尸 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 如果数组或对象中的元素只是简单类型,一层对象或者数组,就是深拷贝 如: let staff1 = {name: 'xiaohong',age: 27}; let staff2 = {...staff}; staff2.name = 'xiaoming' staff1 : {name: 'xiaoho 阅读全文
posted @ 2021-11-17 16:58 小僵尸 阅读(393) 评论(0) 推荐(0) 编辑
摘要: rowKey不唯一 阅读全文
posted @ 2021-11-12 14:04 小僵尸 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 非得要通过 className 来设置 Menu.Item 的样式 阅读全文
posted @ 2021-07-19 14:36 小僵尸 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Y轴上方的留白 设置 boundaryGap 阅读全文
posted @ 2021-06-11 16:38 小僵尸 阅读(976) 评论(0) 推荐(0) 编辑
摘要: 对1求余 number % 1 0 ? ‘整数’ : ‘小数’ 阅读全文
posted @ 2021-06-07 11:21 小僵尸 阅读(168) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 18 下一页