jeudi 19 avril 2018

Removing a specific element from each array in a 2D array

I am trying to remove the 3rd element from each array with the array.

What I have:

data =
[["51.9435","-4.26697","450","125"],
["51.9437","-4.26717","450","125"],
["51.9438","-4.26733","450","125"],
["51.944","-4.26748","450","125"]]

What I need:

data =
[["51.9435","-4.26697","125"],
["51.9437","-4.26717","125"],
["51.9438","-4.26733","125"],
["51.944","-4.26748","125"]]

I have assumed using splice but can not think how I would use it with a 2d array.

Aucun commentaire:

Enregistrer un commentaire