Hi, thanks for replying.
Nevermind the "wait" and and text values, this is the cleaner loop:
Ok then, my intention is to keep updating the "ACTUAL"(old) array with the "NEW" incoming data, because I'll be creating/deleting a related object for every element that needs to be inserted or removed for the ACTUAL array.
That's why I thought of doing this nested loop thing, and I think what should be happening is the following, just like 99instances highlighted:
Actually the loops are suposed to solve this array setup:
NEW = [1,2,3]
ACTUAL = [1,2]
//this means that "3" was newly added and needs to be updated into ACTUAL. Like I said, this update involves creating a few objects and some other mumbojumbo.
Check for missing and push in:
1 exists in ACTUAL = NO //default to NO(on sub loop start)
1 = 1 ? YES
1 = 2 ? ---
Does 1 exists in ACTUAL? yes, do nothing //it will keep marked to be missing until it actually exists, check 3 below
2 exists in ACTUAL = NO //by default
2 = 1? ---
2 = 2? YES
Does 2 exists in ACTUAL? yes, do nothing
3 exists in ACTUAL = NO //default
3 = 1 ?
3 = 2 ?
Does 3 exists in ACTUAL? NO, do do and do.(here I push 3 into actual)