{"ScriptPreparationCode":"var sample = [];\r\nvar testArray = [];\r\n\r\nfunction generateDefinition(i) {\r\n return {\r\n id: i,\r\n children: [\r\n {\r\n id: i\r\n }\r\n ]\r\n };\r\n}\r\n\r\nfor (let i = 10; i \u003E 0; i--){\r\n sample.push(generateDefinition(i));\r\n}\r\n\r\nfor (let i = 0; i \u003C 100; i \u002B\u002B)\r\n{\r\n testArray.push(generateDefinition(i));\r\n}\r\n\r\nfunction contains(list, testItem) {\r\n let result = false;\r\n list.forEach(listItem =\u003E {\r\n if(_.isEqual(listItem, testItem)) {\r\n result = true;\r\n return;\r\n }\r\n });\r\n return result;\r\n}","TestCases":[{"Name":"use foreach \u002B lodash isEqual","Code":"for (var i = 0; i \u003C sample.length; i\u002B\u002B)\r\n{\r\n contains(testArray, sample[i])\r\n}","IsDeferred":false},{"Name":"use lodash some","Code":"for (var i = 0; i \u003C sample.length; i\u002B\u002B)\r\n{\r\n _.some(testArray, sample[i]);\r\n}","IsDeferred":false},{"Name":"use lodash contains","Code":"for (var i = 0; i \u003C sample.length; i\u002B\u002B)\r\n{\r\n _.includes(testArray, sample[i]);\r\n}","IsDeferred":false}]}