} else if (typeof val1 === 'object' && val1 !== null && !Array.isArray(val1)) { diffs.push(...deepDiff(val1, val2, currentPath)); } else if (Array.isArray(val1 ...