couponList =
[{couponEndDate: "2021-11-28",
couponId: "C202110270001",
couponName: "9.8折优惠劵",
couponNo: "1",
couponStatus: "01",
},{
couponEndDate: "2021-09-28",
couponId: "C202110270002",
couponName: "9.6折优惠劵",
couponNo: "1",
couponStatus: "02",
},{
couponEndDate: "2021-12-28",
couponId: "C202110270003",
couponName: "9.7折优惠劵",
couponNo: "1",
couponStatus: "03",
},
{
couponEndDate: "2022-01-28",
couponId: "C202110270004",
couponName: "9.7折优惠劵",
couponNo: "1",
couponStatus: "03",
},
]
const sortCouponList = function(arr) {
let arr1 = arr.sort((a,b) => {
return parseInt(a.couponStatus) - parseInt(b.couponStatus)
})
return [...arr1.filter(ele => ele.couponStatus !== '02'), ...arr1.filter(ele => ele.couponStatus === '02')]
}
console.log(sortCouponList(couponList))
console