2021年1月19日星期二

JS: How to filter object property and became key

I have a object like this

"field": {        "zh":{             "game_code" : "游戏",             "transfer_amount" : "金额",             "uni_id" : "流水号",             "create_time" : "建立时间"        },        "en": {             "game_code" : "GameCode",             "transfer_amount" : "Amount",             "uni_id" : "UniqId.",             "create_time" : "CreateTime"        }      }  }  

and I want to format data like this

data: [    game_code: {      zh: '游戏',      en: 'GameCode'    },    transfer_amount: {      zh: '金额',      en: 'Amount'    }  ]  

what is the best way to do this ? thanks

https://stackoverflow.com/questions/65802452/js-how-to-filter-object-property-and-became-key January 20, 2021 at 10:57AM

没有评论:

发表评论