Home > Mobile >  How to remove an item from 2 array's with the same order?
How to remove an item from 2 array's with the same order?

Time:02-10

So I am trying to remove 2 items from 2 different array's. One with value and one without value but has the same order as the first array.(also I am using discord.js). Here's the code- https://sourceb.in/gUtLbIMoBr I can't upload it here as it contains more then 50 lines. Please help.

CodePudding user response:

You can remove an item from an array like this. And you can it do it multiple times.

When asking a question show your example code and go into more detail.

let arr = ["a","b","c"]
let arr2 = ["A","B","C"]

console.log(arr)
console.log(arr2)

const removeIdx = 1

arr.splice(removeIdx, 1)
arr2.splice(removeIdx, 1)

console.log(arr)
console.log(arr2)

  • Related