Js loop click problem

tocount: function (index,item) {

   for(var i = 0; i < this.datanumber.length; iPP){ //
    if(index == i){
    // console.log(index == i);
     item.bool = !item.bool;
     if(item.bool){
     item.count += 1;
     }
    else{
        item.count -= 1;
    }
    }else{
    continue; break;  return,  //break

break is out of the loop, but the first click I clicked on has passed. Won"t clicking again cycle through the search?
return is the end of the function execution,
then I click again and the function will be executed again. It feels like a circular problem, but I just can"t understand: how break and return found the first one, I haven"t even clicked yet, and I still can"t respond when I click on the second one. Barek is except for the first one.

   }
   }
  return;  //return return
 },

is the following click event, the rookie who has just started to learn, thank you very much.

clipboard.png

Mar.28,2021

1.break is used to completely end a loop, jumping out of the body of the loop to execute the statements after the loop, and
2.continue is to skip the remaining statements in the current loop and execute the next loop.
3. The so-called click event exists all the time unless you log off or release the event.
4.return is called after the loop is completed,

Menu