{"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 contains(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 true;\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n\r\nfunction testArrayContains() {\r\n contains(PromosArray, \u0022regular\u0022);\r\n contains(PromosArray, \u0022markdown\u0022);\r\n contains(PromosArray, \u0022promo\u0022);\r\n}\r\n\r\n \r\nfunction testObjectContains() {\r\n if (PromosObject.regular) {\r\n // skip display logic\r\n }\r\n\r\n if (PromosObject.markdown) {\r\n // skip display logic\r\n }\r\n\r\n if (PromosObject.promo) {\r\n // skip display logic\r\n }\r\n}\r\n\r\nfunction testUnderscoreContains() {\r\n underscore.some(PromosArray, \u0022type\u0022, \u0022regular\u0022);\r\n underscore.some(PromosArray, \u0022type\u0022, \u0022markdown\u0022);\r\n underscore.some(PromosArray, \u0022type\u0022, \u0022promo\u0022);\r\n}\r\n\r\nfunction testLodashContains() {\r\n lodash.some(PromosArray, \u0022type\u0022, \u0022regular\u0022);\r\n lodash.some(PromosArray, \u0022type\u0022, \u0022markdown\u0022);\r\n lodash.some(PromosArray, \u0022type\u0022, \u0022promo\u0022);\r\n}\r\n","TestCases":[{"Name":"testArrayContains","Code":"testArrayContains();","IsDeferred":false},{"Name":"testObjectContains","Code":"testObjectContains();","IsDeferred":false},{"Name":"testUnderscoreContains","Code":"testUnderscoreContains();","IsDeferred":false},{"Name":"testLodashContains","Code":"testLodashContains();","IsDeferred":false}]}