10 2022 档案

摘要:前端开发过程中,经常遇到时间比大小,只需要用getTime()方法即可 function compare(a, b){ return a.getTime() > b.getTime(); } 阅读全文
posted @ 2022-10-19 11:33 li阿根 阅读(461) 评论(0) 推荐(0)
摘要:js如何判断对象是否为空? obj=={ }? 不是这样的吧! 一起来看看 function isEmpty(obj){ return Reflect.ownKeys(obj).length 0 && obj.constructor Object; } 阅读全文
posted @ 2022-10-19 11:32 li阿根 阅读(56) 评论(0) 推荐(0)
摘要:做前端开发的同学是不是经常封装一些常用的函数方法,比如,日期格式、对象转换等。话不多说,直接总结一些常用的封装函数直接放在utils中拿来即用! //数组对象深拷贝const deepCopy = function (source) { return JSON.parse(JSON.stringif 阅读全文
posted @ 2022-10-17 10:09 li阿根 阅读(216) 评论(0) 推荐(0)