I am trying to write the code of following algorithm
- I have an array of
active_id(array) IDcoming from url (string)- if value of ID does not exist in active_id array
- run the function A()
- else do nothing.
Note - function A() should be run only once.
I tried writing the code
for (var i = 0; i < activeIds.length; i++) {
if (activeIds[i] != uid) {
A(); //This is running multiple times.
}
I tried using while loop
var i = 0;
while (activeIds[i] != uid) {
A(); //This is running multiple times again.
i++;
}
There is something i am missing. not able to figure it out.