When you know the index If we know the index of the item we want to remove we can perform a simple splice function removeAtIndex(arr, idx) { arr.splice(idx, 1); } let nums = [1,2,3,4]; removeAtIndex(nums, 2); // nums = [1,2,4] Explanation: .splic...

Markdown supported · ⌘↵ to post
No responses yet.