lay

Results 6 comments of lay

```js const debouce = ( fn: () => void, wait: number = 50, immediate: boolean = true ) => { let timer: number | null, context: any, args: any; const...

```js const add = (a: number, b: number, c: number) => a + b + c; const adding = (...args: number[]) => args.reduce((pre, cur) => pre + cur, 0); //参数确定...

```js const lengthOfLongestSubString = (s: string) => { let left = 0, right = 0, res = 0, map = new Map(); while (right < s.length) { if (map.has(s[right])) {...

```js const mergeSort = (arr1: number[], arr2: number[]) => { const len1 = arr1.length, len2 = arr2.length; let i = 0, j = 0, arr = []; if (len1 ===...

> **答案** > yideng is 21 ƒ sayHi(age) {return `${this.name} is ${age}`;} > > **解析** > 使用两者,我们可以传递我们想要`this`关键字引用的对象。 但是,`.call`方法会立即执行! > `.bind`方法会返回函数的拷贝值,但带有绑定的上下文! 它不会立即执行。 yideng is 21 错了

```js const fibonacci = (n: number) => { let pre = 1, cur = 1; if (n === 1 || n === 2) { return 1; } for (let i...