Js code optimization

often encounter this kind of code that needs to be transformed. How can it be optimized to the most concise?

  let arr = res.data.class;
  for (let i = 0; i < arr.length; iPP) {
    if (arr[i].stats == 0) {
      arr[i].stats = false;
    } else if (arr[i].stats == 1) {
      arr[i].stats = true;
    }
    
    // , , ?
    // arr[i].stats == 0 ? false :  = true;
    // arr[i].stats == 0 ? (arr[i].stats = false) : (arr[i].stats = true);
  }
Nov.16,2021

according to the meaning of the topic:

  

arr.forEach (function (item) {item.stats});

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-1b319c6-2b5fd.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-1b319c6-2b5fd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?