{"ScriptPreparationCode":"var PromosArray = [\r\n {\r\n type: \u0022regular\u0022,\r\n display: \u0022$123.00\u0022\r\n },\r\n {\r\n type: \u0022markdown\u0022,\r\n display: \u0022$100.00\u0022\r\n },\r\n {\r\n type: \u0022promo\u0022,\r\n display: \u0022$80.00\u0022\r\n }\r\n];\r\n\r\nvar PromosObject = {\r\n regular: \u0022$123.00\u0022,\r\n markdown: \u0022$100.00\u0022,\r\n promo: \u0022$80.00\u0022\r\n};\r\n\r\nfunction find(array, type) {\r\n for (var i = 0; i \u003C array.length; i\u002B\u002B) {\r\n if (array[i][\u0022type\u0022] === type) {\r\n return array[i];\r\n }\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nfunction testArrayFind() {\r\n find(PromosArray, \u0022regular\u0022);\r\n find(PromosArray, \u0022markdown\u0022);\r\n find(PromosArray, \u0022promo\u0022);\r\n}\r\n\r\nfunction testObjectFind() {\r\n var foo = PromosObject.regular;\r\n var foo = PromosObject.markdown;\r\n var foo = PromosObject.promo;\r\n}\r\n\r\nfunction testUnderscoreFind() {\r\n underscore.find(PromosArray, \u0022type\u0022, \u0022regular\u0022);\r\n underscore.find(PromosArray, \u0022type\u0022, \u0022markdown\u0022);\r\n underscore.find(PromosArray, \u0022type\u0022, \u0022promo\u0022);\r\n}\r\n\r\nfunction testLodashFind() {\r\n lodash.find(PromosArray, \u0022type\u0022, \u0022regular\u0022);\r\n lodash.find(PromosArray, \u0022type\u0022, \u0022markdown\u0022);\r\n lodash.find(PromosArray, \u0022type\u0022, \u0022promo\u0022);\r\n}\r\n\r\n\r\n\r\n\r\n","TestCases":[{"Name":"testArrayFind();","Code":"testArrayFind();","IsDeferred":false},{"Name":"testObjectFind();","Code":"testObjectFind();","IsDeferred":false},{"Name":"testUnderscoreFind();","Code":"testUnderscoreFind();","IsDeferred":false},{"Name":"testLodashFind();","Code":"testLodashFind();","IsDeferred":false}]}