Remove Items From An Array In Javascript
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...
firefields.com3 min read