HTML_09/js/public.js
@@ -264,4 +264,21 @@ }); }); } } } //深拷贝 function deepClone(source) { if (typeof source !== 'object' || source == null) { return source; } const target = Array.isArray(source) ? [] : {}; for (const key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (typeof source[key] === 'object' && source[key] !== null) { target[key] = deepClone(source[key]); } else { target[key] = source[key]; } } } return target; }