In my array, all = [2,3,4,12, 55,33]
, there is a sub-array named ar1 = [12, 55, 33]
starting from the value 12.
If I remove a value from all
that is present in ar1
(e.g. 12), how can I determine the index of this value in ar1
(0 for 12) so I can also remove it from ar1
?
Edit: The elements in my actual array are objects; I have used numbers here for illustration purposes.