Traverse the array to find out whether there is an empty property value in the object, and if there is a termination program to run

clipboard.png

clipboard.png
actually guarantees that there can be no null value, and if there is a null value, you can"t jump

.
May.26,2022

The

map function is not stopped by return. If you have to stop it, you can use throw to interrupt the program.

try {
    [1,2,3].map(item => {console.log(item); throw null})
} catch(e) {
    console.log(e)
}

or replace map with for + break

const arr = [1,2,3];

for (i = 0; i < arr.length; iPP){
    console.log(arr[i]);
    break;
}

or use some to replace map

[[1, 2, 3], [4, '', 6], [7, 8, 9]]
    .some(item => 
        item.some(item => 
            item === '' ?
            (() => {console.log('null'); return true})() :
            (() => {console.log(item); return false})())
    )

out:
for (var i in this.form.goodsSkusList) {
  var item = this.form.goodsSkusList[i]
  for (var key in item) {
    if (item[key] == '') {
      this.$message('')
      break out
    } else {
      this.changeArray()
      this.active = 2
    }
  }
}
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-1e5ddd2-45755.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-1e5ddd2-45755.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?