there is an array from which you want to get a new array with a slightly different structure.
/ / there is now an array of alist
var alist=[
{"name":"sh","tel":"13435555454","id":1},
{"name":"kk","tel":"1343566454","id":2},
{"name":"rr","tel":"1343937454","id":3}
]
/ / if you want to generate a blist based on the above alist, take each item of the alist to get the following new list, which requires that the positionName attribute corresponds to the name attribute and the contactId attribute corresponds to the id attribute
blist=[
{"positionName":"sh","contactId":1},
{"positionName":"kk","contactId":2},
{"positionName":"rr","contactId":3}
]
how can it be realized? Front-end rookie, do not have a solid grasp of some data operations of js. The God of trouble instructed 0.0