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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ad16-345f4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ad16-345f4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?