12 2019 档案
摘要:数组去重是一道很常见的面试题,方法也是不尽相同,除去最常见的Set方法外,记录两种简便的数组去重方法 let arrs=[1,2,3,1,2,3,NaN,NaN,null,null,undefined,undefined,'a','a'] function dery(arr){ return arr
阅读全文
摘要:const list={} // 将事件名和事件函数装进事件池里 function $on(name,func) { if(!name || !func) return; if(!Object.keys(list).includes(name)){ list[name]=func; } } // 根
阅读全文
摘要:function createTime(t) { let timer; if (t <= 0 || !t || t < 60 || typeof(t)!=='number') timer = "default"; if (t >= 3600) timer = "hours"; if (t < 360
阅读全文

浙公网安备 33010602011771号