{"ScriptPreparationCode":"function 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 if (a.constructor !== b.constructor) return false;\r\n\r\n var length, i, keys;\r\n if (Array.isArray(a)) {\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\r\n\r\n if (a.constructor === RegExp) return a.source === b.source \u0026\u0026 a.flags === b.flags;\r\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\r\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\r\n\r\n keys = Object.keys(a);\r\n length = keys.length;\r\n if (length !== Object.keys(b).length) return false;\r\n\r\n for (i = length; i-- !== 0;)\r\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\r\n\r\n for (i = length; i-- !== 0;) {\r\n var key = keys[i];\r\n\r\n if (!equal(a[key], b[key])) return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n // true if both NaN, false otherwise\r\n return a!==a \u0026\u0026 b!==b;\r\n};\r\n\r\n \r\n// 1 level deep\r\nvar excludedProps = [\r\n\t\u0027prop4\u0027, \u0027prop6\u0027,\r\n];\r\nvar data = [\r\n {\r\n description: \u0027equal numbers\u0027,\r\n value1: 1,\r\n value2: 1,\r\n equal: true,\r\n },\r\n {\r\n description: \u0027not equal numbers\u0027,\r\n value1: 1,\r\n value2: 2,\r\n equal: false,\r\n },\r\n {\r\n description: \u0027number and array are not equal\u0027,\r\n value1: 1,\r\n value2: [],\r\n equal: false,\r\n },\r\n {\r\n description: \u00270 and null are not equal\u0027,\r\n value1: 0,\r\n value2: null,\r\n equal: false,\r\n },\r\n {\r\n description: \u0027equal strings\u0027,\r\n value1: \u0027a\u0027,\r\n value2: \u0027a\u0027,\r\n equal: true,\r\n },\r\n {\r\n description: \u0027big object\u0027,\r\n value1: {\r\n prop1: \u0027value1\u0027,\r\n prop2: \u0027value2\u0027,\r\n prop3: \u0027value3\u0027,\r\n prop4: {\r\n subProp1: \u0027sub value1\u0027,\r\n subProp2: {\r\n subSubProp1: \u0027sub sub value1\u0027,\r\n subSubProp2: [\r\n 1,\r\n 2,\r\n { prop2: 1, prop: 2 },\r\n 4,\r\n 5,\r\n ],\r\n },\r\n },\r\n prop5: 1000,\r\n prop6: new Date(2016, 2, 10),\r\n },\r\n value2: {\r\n prop5: 1000,\r\n prop3: \u0027value3\u0027,\r\n prop1: \u0027value1\u0027,\r\n prop2: \u0027value2\u0027,\r\n prop6: new Date(\u00272016/03/10\u0027),\r\n prop4: {\r\n subProp2: {\r\n subSubProp1: \u0027sub sub value1\u0027,\r\n subSubProp2: [\r\n 1,\r\n 2,\r\n { prop2: 1, prop: 2 },\r\n 4,\r\n 5,\r\n ],\r\n },\r\n subProp1: \u0027sub value1\u0027,\r\n },\r\n },\r\n equal: true,\r\n },\r\n ];","TestCases":[{"Name":"lodash","Code":"data.forEach((item) =\u003E {\r\n _.isEqual( _.omit(item.value1,excludedProps), _.omit(item.value2,excludedProps));\r\n });","IsDeferred":false},{"Name":"fast-deep-equal","Code":"data.forEach((item) =\u003E {\r\n\t\t\t\t\t\t\tequal( _.omit(item.value1,excludedProps), _.omit(item.value2,excludedProps));\r\n });","IsDeferred":false}]}