{"ScriptPreparationCode":"var isArray = Array.isArray;\r\nvar keyList = Object.keys;\r\nvar hasProp = Object.prototype.hasOwnProperty;\r\n\r\nfunction equal(a, b) {\r\n if (a === b) return true;\r\n\r\n if (a \u0026\u0026 b \u0026\u0026 typeof a == \u0027object\u0027 \u0026\u0026 typeof b == \u0027object\u0027) {\r\n var arrA = isArray(a)\r\n , arrB = isArray(b)\r\n , i\r\n , length\r\n , key;\r\n\r\n if (arrA \u0026\u0026 arrB) {\r\n length = a.length;\r\n if (length != b.length) return false;\r\n for (i = length; i-- !== 0;)\r\n if (!equal(a[i], b[i])) return false;\r\n return true;\r\n }\r\n\r\n if (arrA != arrB) return false;\r\n\r\n var dateA = a instanceof Date\r\n , dateB = b instanceof Date;\r\n if (dateA != dateB) return false;\r\n if (dateA \u0026\u0026 dateB) return a.getTime() == b.getTime();\r\n\r\n var regexpA = a instanceof RegExp\r\n , regexpB = b instanceof RegExp;\r\n if (regexpA != regexpB) return false;\r\n if (regexpA \u0026\u0026 regexpB) return a.toString() == b.toString();\r\n\r\n var keys = keyList(a);\r\n length = keys.length;\r\n\r\n if (length !== keyList(b).length)\r\n return false;\r\n\r\n for (i = length; i-- !== 0;)\r\n if (!hasProp.call(b, keys[i])) return false;\r\n\r\n for (i = length; i-- !== 0;) {\r\n key = keys[i];\r\n if (!equal(a[key], b[key])) return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n return a!==a \u0026\u0026 b!==b;\r\n};\r\n\r\n// 1 level deep\r\nwindow.foo1 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2 } } };\r\nwindow.bar1 = { a: 1, b: 3, c: { a: 1, b: 2, c: { a: 1, b: 2 } } };\r\n\r\n// 2 levels deep\r\nwindow.foo2 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2 } } };\r\nwindow.bar2 = { a: 1, b: 2, c: { a: 1, b: 3, c: { a: 1, b: 2 } } };\r\n\r\n// 3 levels deep\r\nwindow.foo3 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2 } } };\r\nwindow.bar3 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 4 } } };","TestCases":[{"Name":"lodash","Code":"_.isEqual(window.foo1, window.bar1)","IsDeferred":false},{"Name":"fast-deep-equal","Code":"equal(window.foo1, window.bar1);","IsDeferred":false},{"Name":"JSON","Code":"JSON.stringify(window.foo1) === JSON.stringify(window.bar1);","IsDeferred":false}]}