I'm having trouble figuring how to delete an item from array where the items are indexed in a manner similar to the following:
arr[32] = 123
arr[39] = 456
arr[92] = 789
...
The two ways I have tried to delete single, specific items from said array have resulted in all items being removed.
Attempted Method #1:
arr.splice(39, 1);
Attempted Method #2:
arr.forEach(function(val, key) {
if (val == 456) {
arr.splice(key, 1);
}
}
Now obviously this isn't exactly what my code looks like, but it shows what I've tried well enough. If I am missing any important details, or you want me to pick the code from source to see if it is within the source instead of the methodology, please ask
arractually have items with index 0-92 as well, or isarractually an object with keys? Removing an item from the array will change the indexes and could be causing other issues with your logic here.