Meta
Results
2
comments of
Meta
参考@fengshenhai-0727大兄弟的,即使数组有重复的交集项也没问题。 ```javascript function getTwoArrsCommon(arr1, arr2) { if(!arr1.length || !arr2.length) { return []; } const res = []; const map = {}; for(let k of arr1) { if(map[k]) { map[k]++; }...
``` function _new(fn, ...args) { const obj = Object.create(fn.prototype); const res = fn.apply(obj, args); const type = typeof res; if((type === "object" || type === "function") && res !== null)...