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
    }
  }
}
Menu