I got an Array a = [1,2,3,4,5]
and an Array b = [1,3]
which contains some elements of a
. So it is a kind of a sub array of a
.
In this for loop below, I can use the elements of b
to "do smething". Now, how can I interact in the same loop with the elements of a
that are not a part b
? That means 2, 4 and 5
from a
? How to filter them out?
function action (){
for (var i=0; i<b.length; i++) {
b[i].x = "do something";
}
Thanks so much"