let saveObj = {
"stepInfo": {
"companyChannel": [
"1",
"2",
"3"
],
"promotionSteps": [
{
"minAmount": 12,
"maxAmount": 333,
"mainStep": 0,
"returnBcoupon": [
{
"batchId": "121",
"number": 2,
"replaceFastCarCoupon": "1",
"fastCarBatchId": "332",
"fastCarNumber": 12
},
{
"batchId": "123",
"number": 123,
"replaceFastCarCoupon": "1",
"fastCarBatchId": "3",
"fastCarNumber": 4
}
]
},
{
"minAmount": 3,
"maxAmount": 122,
"mainStep": 0,
"returnBcoupon": [
{
"batchId": "11",
"number": 2,
"replaceFastCarCoupon": "1",
"fastCarBatchId": "12",
"fastCarNumber": 33
},
{
"batchId": "122",
"number": 12
}
]
},
{
"minAmount": 33,
"maxAmount": 121221,
"mainStep": 0
},
{
"minAmount": 12,
"maxAmount": 14,
"mainStep": 0,
"returnBcoupon": [
{
"batchId": "33",
"number": 12,
"replaceFastCarCoupon": "1",
"fastCarBatchId": "12",
"fastCarNumber": 33
},
{
"batchId": "44",
"number": 12
},
{
"batchId": "4441",
"number": 122
}
]
}
],
"stepCrowdTag": "1001271955",
"time": [
"2022-07-13T09:32:30.252Z",
"2022-07-22T09:32:30.252Z"
],
"startTime": "2022-07-13 17:32:30",
"endTime": "2022-07-22 17:32:30"
}
}
let saveObjLen = saveObj["stepInfo"]["promotionSteps"].length
let saveArrPro = saveObj["stepInfo"]["promotionSteps"]
let arr = []
if(saveObjLen > 1){
saveArrPro.some((item,index)=>{
Object.keys(item).some(ele=>{
if(ele == "minAmount" || ele == "maxAmount"){
arr.push(item[ele])
}
})
})
}
console.log(arr)
console