{"ScriptPreparationCode":null,"TestCases":[{"Name":"Vanilla","Code":"const offerGameIds = [\r\n {\r\n GameId: \u00274208\u0027\r\n }, {\r\n GameId: \u00274017\u0027\r\n }, {\r\n GameId: \u00274070\u0027\r\n }, {\r\n GameId: \u00274035\u0027\r\n }, {\r\n GameId: \u00274110\u0027\r\n }, {\r\n GameId: \u00274218\u0027\r\n }, {\r\n GameId: \u00274114\u0027\r\n }, {\r\n GameId: \u00274193\u0027\r\n }, {\r\n GameId: \u00274219\u0027\r\n }, {\r\n GameId: \u00274184\u0027\r\n }, {\r\n GameId: \u00274216\u0027\r\n }, {\r\n GameId: \u00274142\u0027\r\n }\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 commonIds = offerGameIds.map(item =\u003E \u002Bitem.GameId).filter(id =\u003E cmsGameIds.includes(id));\r\nconst remainingIds = cmsGameIds.filter(id =\u003E !commonIds.includes(id));\r\n\r\nconst finalArray = commonIds.concat(remainingIds);\r\n","IsDeferred":false},{"Name":"Lodash","Code":"const offerGameIds = [\r\n {\r\n GameId: \u00274208\u0027\r\n }, {\r\n GameId: \u00274017\u0027\r\n }, {\r\n GameId: \u00274070\u0027\r\n }, {\r\n GameId: \u00274035\u0027\r\n }, {\r\n GameId: \u00274110\u0027\r\n }, {\r\n GameId: \u00274218\u0027\r\n }, {\r\n GameId: \u00274114\u0027\r\n }, {\r\n GameId: \u00274193\u0027\r\n }, {\r\n GameId: \u00274219\u0027\r\n }, {\r\n GameId: \u00274184\u0027\r\n }, {\r\n GameId: \u00274216\u0027\r\n }, {\r\n GameId: \u00274142\u0027\r\n }\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}]}