{"ScriptPreparationCode":"window.foo = { arr: [1, 3], num: 12, o: { name: \u0027foo\u0027 }, quantum: [{ spin: \u0027x\u0027 }, { spin: \u0027y\u0027 }]};\r\nwindow.bar = { arr: [1, 2], num: 12, o: { name: \u0027foo\u0027 }, quantum: [{ spin: \u0027x\u0027 }, { spin: \u0027y\u0027 }]};\r\n\r\nvar isArray = Array.isArray;\r\nvar keyList = Object.keys;\r\nvar hasProp = Object.prototype.hasOwnProperty;\r\n\r\nfunction fastEqual(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 (!fastEqual(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 (!fastEqual(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\nwindow.fastEqual = fastEqual;","TestCases":[{"Name":"_.isEqual","Code":"_.isEqual(window.foo, window.bar)","IsDeferred":false},{"Name":"JSON.stringify","Code":"JSON.stringify(window.foo) === JSON.stringify(window.bar);","IsDeferred":false},{"Name":"fastEqual","Code":"window.fastEqual(window.foo, window.bar);","IsDeferred":false}]}