js深拷贝函数
// 深拷贝函数 const _clone = (data) => { if (!data || !(data instanceof Object) || typeof data == 'function') { return data || undefined } let constructor = data.constructor let result = new constructor() for (var key in data) { if (data.hasOwnProperty(key)) { result[key] = _clone(data[key]) } } return result }