{"ScriptPreparationCode":null,"TestCases":[{"Name":"equality by gettingDifferences","Code":"const equalArrays = (arr1, arr2) =\u003E arr1.length === arr2.length \u0026\u0026\r\narr1.every((element, index) =\u003E getDifferences(element, arr2[index]) === undefined)\r\n\r\nfunction getDifferences(original, modified) {\r\n if (original instanceof Array \u0026\u0026 modified instanceof Array) {\r\n return equalArrays(original, modified)\r\n ? undefined\r\n : modified\r\n }\r\n if (original instanceof Object \u0026\u0026 modified instanceof Object) {\r\n let result = {}\r\n for (const key of Object.keys(modified)) {\r\n const diff = getDifferences(original[key], modified[key])\r\n if (diff !== undefined) {\r\n result[key] = diff\r\n }\r\n }\r\n return !Object.keys(result).length\r\n ? undefined\r\n : result\r\n }\r\n return original === modified\r\n ? undefined\r\n : modified\r\n}\r\n","IsDeferred":false},{"Name":"equality by self function","Code":"const deepEqual = (thing1, thing2) =\u003E {\r\n if (thing1 instanceof Object \u0026\u0026 thing2 instanceof Object)\r\n \treturn Object.keys(thing1).every(key =\u003E deepEqual(thing1[key], thing2[key]))\r\n return thing1 === thing2\r\n}","IsDeferred":false}]}