{"ScriptPreparationCode":null,"TestCases":[{"Name":"splice","Code":"const loyaltyPrograms = [{\r\n id: 1\r\n}, {\r\n id: 2\r\n}, {\r\n id: 3\r\n}, {\r\n id: 4\r\n}, {\r\n id: 5\r\n}];\r\nlet id = 3;\r\nconst loyaltyProgramIndex = loyaltyPrograms.findIndex((item) =\u003E item.id === id);\r\nif (loyaltyProgramIndex === -1) {\r\n return;\r\n}\r\n\r\n// replace existing object with new one\r\nloyaltyPrograms.splice(loyaltyProgramIndex, 1);","IsDeferred":false},{"Name":"filter","Code":"let loyaltyPrograms = [{\r\n id: 1\r\n}, {\r\n id: 2\r\n}, {\r\n id: 3\r\n}, {\r\n id: 4\r\n}, {\r\n id: 5\r\n}];\r\nlet id = 3;\r\nloyaltyPrograms = loyaltyPrograms.filter((item) =\u003E item.id !== id);","IsDeferred":false}]}