{"ScriptPreparationCode":null,"TestCases":[{"Name":"Map, filter, concat","Code":"const offerGameIds = [\r\n { GameId: \u00274222\u0027}, \r\n { GameId: \u00274208\u0027},\r\n { GameId: \u00274165\u0027},\r\n { GameId: \u00274434\u0027},\r\n { GameId: \u00274200\u0027},\r\n { GameId: \u00274182\u0027},\r\n { GameId: \u00274215\u0027},\r\n { GameId: \u00274114\u0027},\r\n { GameId: \u00274219\u0027},\r\n { GameId: \u00274035\u0027},\r\n { GameId: \u00274070\u0027},\r\n];\r\n\r\nconst cmsGameIds = [4222, 4253, 4215, 4141, 4178, 4182, 4135, 4217, 4200, 4194, 4114, 4193, 4219, 4184, 4216, 4142, 4079, 4070, 4035, 4110];\r\n\r\nconst infoOfferGameIds = offerGameIds.map(item =\u003E \u002Bitem.GameId)\r\nconst includedGameIds = offerGameIds.filter(id =\u003E cmsGameIds.includes(id));\r\nconst combinedGameIds = cmsGameIds.filter(id =\u003E !includedGameIds.includes(id));\r\n\r\nconst finalArray = includedGameIds.concat(combinedGameIds);","IsDeferred":false},{"Name":"Intersection, union","Code":"const offerGameIds = [\r\n { GameId: \u00274222\u0027}, \r\n { GameId: \u00274208\u0027},\r\n { GameId: \u00274165\u0027},\r\n { GameId: \u00274434\u0027},\r\n { GameId: \u00274200\u0027},\r\n { GameId: \u00274182\u0027},\r\n { GameId: \u00274215\u0027},\r\n { GameId: \u00274114\u0027},\r\n { GameId: \u00274219\u0027},\r\n { GameId: \u00274035\u0027},\r\n { GameId: \u00274070\u0027},\r\n];\r\n\r\nconst cmsGameIds = [4222, 4253, 4215, 4141, 4178, 4182, 4135, 4217, 4200, 4194, 4114, 4193, 4219, 4184, 4216, 4142, 4079, 4070, 4035, 4110];\r\n\r\nconst infoOfferGameIds = offerGameIds.map(item =\u003E \u002Bitem.GameId);\r\nconst intersection = _.intersection(infoOfferGameIds, cmsGameIds);\r\n\r\nconst finalArray = _.union(intersection, _.without(cmsGameIds, ...intersection));","IsDeferred":false}]}