摘要:
function myNew(constructor,...args){ if(typeof constructor!=='function'){ return new TypeError('constructor must be a function'); } const newObj=Objec 阅读全文
posted @ 2025-12-25 15:48
howhy
阅读(24)
评论(0)
推荐(0)
摘要:
function deepCopy(obj){ if(obj null || obj undefined || typeof obj!=='object'){ return obj; } if(Array.isArray(obj)){ return obj.map(item=>deepCopy(it 阅读全文
posted @ 2025-12-25 15:25
howhy
阅读(35)
评论(0)
推荐(0)
摘要:
1、如果类型相同,无须转换 2、如果其中一个操作值是null或undefined,,则另一个操作值必须是null或undefined才会返回true,否则返回false 3、如果其中一个操作值是Symbol 则返回false 4、如果操作值为string或number,则将string转为numbe 阅读全文
posted @ 2025-12-25 13:31
howhy
阅读(38)
评论(0)
推荐(0)
摘要:
function getType(obj){ const type=typeof obj; console.log(type); if(type!=='object'){ return type; } return Object.prototype.toString.call(obj).replac 阅读全文
posted @ 2025-12-25 11:18
howhy
阅读(35)
评论(0)
推荐(0)

浙公网安备 33010602011771号