合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
```js export function deepCopy (data) { const type = typeOf(data) let obj if (type === 'array') { obj = [] } else if (type === 'object') { obj = {} } else { return data } if (type === 'array') { for (let i = 0; i < data.length; i++) { obj.push(deepCopy(data[i])) } } else if (type === 'object') { for (const i in data) { obj[i] = deepCopy(data[i]) } } return obj } ```