摘要: 前端开发过程中,经常遇到时间比大小,只需要用getTime()方法即可 function compare(a, b){ return a.getTime() > b.getTime(); } 阅读全文
posted @ 2022-10-19 11:33 li阿根 阅读(361) 评论(0) 推荐(0) 编辑
摘要: js如何判断对象是否为空? obj=={ }? 不是这样的吧! 一起来看看 function isEmpty(obj){ return Reflect.ownKeys(obj).length 0 && obj.constructor Object; } 阅读全文
posted @ 2022-10-19 11:32 li阿根 阅读(27) 评论(0) 推荐(0) 编辑