Accessing an array inside a JS object and removing an item from it by index
问题 Let's say I have an object where the values are arrays, like this: { 123456: ['apple','orange','banana'], 987654: ['dog','cat','mouse'], 112233: ['car','truck','bike'] } and that I have access to 2 variables, itemID that has the key assigned to it, and the array index of the item I want to remove. For example itemID = 987654; n = 1; So the resulting object I want to get would be { 123456: ['apple','orange','banana'], 987654: ['dog','mouse'], 112233: ['car','truck','bike'] } I need to write a