const removeByIndex = (items, indexToRemove) => { return items.filter((item, index) => index !== indexToRemove) }
import unittest from removeByIndex import removeByIndex class TestRemoveByIndex(unittest.TestCase): def test_removeByIndex(self): self.assertEqual(removeByIndex([1, 2, 3, 4], 2), [1, 2, 4])