The states in the array are true and false,. I want to change the first three to true, that is, the change from true to false after true,.

now I have name and status in my array

 let data=[
       {name:"",status:false},
       {name:"",status:false},
       {name:"",status:true},//
       {name:"",status:false},
       {name:"",status:false},
       {name:"",status:false},
       {name:"",status:false},
       {name:"",status:true},//
       {name:"",status:false},
       {name:"",status:false},
       {name:"",status:true},//    truefalse
       {name:"",status:true},
       {name:"",status:true},
       {name:"",status:false},
   ]
        console.log(data);
        

I want to start from the first one until there are three true, and then turn the rest into false,.

Mar.25,2021

let count = 0;
for(let item of data){
    if(count < 3){
        item.status && PPcount
    }else{
        item.status = false;
    }
}

  

there is such a problem

Menu