1
let row = warehouse_delivery_transaction.find(x => x.kerry_status_name === 'CCC')
    if (!row) {
      let item = warehouse_delivery_transaction.find(x => x.kerry_status_name === 'BBB')
      if (item) {
        warehouse_delivery_transaction.push({
          code: item.code,
          kerry_status_name: 'CCC',
          location: '',
          status_date: item.status_date
        })
      }
    }

Output before 1.AAA 2.BBB 3.DDD

Output After I push data 1.AAA 2.BBB 3.DDD 4.CCC

I want it to come out like this.

1.AAA 2.BBB 3.CCC 4.DDD

0 Answers0