Remove Items From An Array In Javascript
Sep 6, 2022 · 3 min read · 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...
Join discussion



