摘要: function myDeepClone(o){ const result = new (Object.getPrototypeOf(o)).constructor for(k in o){ if(typeof o[k] 'object' && o[k] !== null){ result[k] = 阅读全文
posted @ 2023-06-02 19:06 睡成蛆 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 个人练习,代码如下: function myInstanceOf(o,type){ if(typeof o !== 'object' || o null){ return false } if(Object.getPrototypeOf(o) type.prototype){ return true 阅读全文
posted @ 2023-06-02 18:44 睡成蛆 阅读(12) 评论(0) 推荐(0) 编辑