摘要: function _runtask(task,callback){ const startTime=Date.now() requestAnimationFrame(()=>{ if(Date.now()-startTime<16.6){ task() callback() }else{ _runt 阅读全文
posted @ 2024-04-28 18:43 howhy 阅读(2) 评论(0) 推荐(0) 编辑
摘要: class User { constructor(name, age) { this.name = name this.age = age } static print(age) { console.log(this.name + ' ' + age) } sayHello() { console. 阅读全文
posted @ 2024-04-28 17:35 howhy 阅读(1) 评论(0) 推荐(0) 编辑
摘要: function deepClone(obj) { if (typeof obj !== 'object' || obj null) { return obj } const result = Array.isArray(obj) ? [] : {} Object.setPrototypeOf(re 阅读全文
posted @ 2024-04-28 16:09 howhy 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2024-04-28 15:28 howhy 阅读(4) 评论(0) 推荐(0) 编辑
摘要: function isPrimitive(obj) { return obj null || !['object', 'function'].includes(typeof obj) } function objEqual(obj1, obj2) { //console.log(isPrimitiv 阅读全文
posted @ 2024-04-28 14:47 howhy 阅读(3) 评论(0) 推荐(0) 编辑