链表
class ListNode {
val: number
next: ListNode | null
constructor(val: number = 0, next: ListNode | null = null) {
this.val = val
this.next = next
}
}
小于 1 分钟
class ListNode {
val: number
next: ListNode | null
constructor(val: number = 0, next: ListNode | null = null) {
this.val = val
this.next = next
}
}
thisArg 和原函数的参数 argsthisArg 为 undefined,则赋值全局对象 windowotherArgscallback 和 thisArgcallbackfn 不会立即执行,而是等待一段时间fndebounce 表现为延迟执行fn 立即执行fnthrottle 表现为按一定频率执行柯里化函数能将一个接受多个参数的函数,转换为一个接受单一参数的函数,其会返回另一个函数,并继续接受剩余的参数
如下所示,foo 和 bar 函数的返回结果均为 a + b + c = 10,调用的方式却不相同。foo 函数一次性将所有参数传入,而 bar 函数则是逐个参数传入。foo 函数转换为 bar 函数的过程,即 currying 柯里化。