-1

"data": [

    {
        "bindCardId": 4365465475,
        "cardNo": "12312431241",
        "bankName": "光大银行",
        "logo": "http://localhost/bankIcon/CEB.png",
        "singleAmount": "10000.0",
        "maxAmount": "20000.0"
    },
    {
        "bindCardId": 4365465475,
        "cardNo": "12312431241",
        "bankName": "光大银行",
        "logo": "http://localhost/bankIcon/CEB.png",
        "singleAmount": "10000.0",
        "maxAmount": "20000.0"
    }
]

上面是一个数组,现在只取bindCardId、cardNo、logo、bankName这四个值,放在一个新的数组里面,求解,谢谢大家

2017-10-30 提问

查看全部 3 个回答

4

已采纳
var newData = data.map(item => {
    const { bindCardId, cardNo, bankName, logo } = item
    return {
        bindCardId, cardNo, bankName, logo
    }
})

推广链接