摘要: 函数实现累加计算,其实就是函数科里化的一个过程, add(1) => 1 add(1)(2) => 3 add(1)(2)(3) => 6 1、通过闭包原理以及toString方法 function add(...a) { let res = 0; a.forEach(item => (res += 阅读全文
posted @ 2021-02-14 19:29 程序員劝退师 阅读(418) 评论(0) 推荐(0) 编辑
摘要: 一、首先我们先看一下类(class)组件整个周期包含哪些: class MyComponent extends Component { // 挂载卸载阶段 constructor(props: any) { super(props); this.state = { name: 'Hello Worl 阅读全文
posted @ 2021-02-14 12:03 程序員劝退师 阅读(4220) 评论(0) 推荐(0) 编辑