Tag:Depth judgement

  • Judge that two object fields are the same through JS depth

    Time:2019-11-13

    Code: /** *Determine whether this object is of object type * @param {Object} obj */ function isObject(obj){ return Object.prototype.toString.call(obj)==='[object Object]’; }; /** *Determine whether this type is array type * @param {Array} arr */ function isArray(arr){ return Object.prototype.toString.call(arr)==='[object Array]’; }; /** *Depth compares whether two objects are the same * @param {Object} oldData * @param […]