yuanxiang

Results 4 comments of yuanxiang

``` var list = [{ id: '1', children: [{ id: '11', children: [{ id: '111' }, { id: '112' }] }, { id: '12', children: [{ id: '121' }, {...

``` class LazyManClass { constructor(name) { this.taskList = []; this.sayName(name); setTimeout(() => { this.start(); }, 0) } eat(food) { this.taskList.push(() => { console.log(`Hi I eating ${food}`) const fn = this.taskList.shift();...

``` const input = '1, 2, 3, 5, 7, 8, 10'; function change(str) { let inputArray = str.split(','); let res = []; let i = 0, j = 0 while...

参考上面几位大佬的答案整理了一下 ``` function deepClone(target, cache = []) { if (typeof target !== 'object') { return target } let hit = cache.filter(item => item.origin === target)[0]; if (hit) { return hit.copy;...