I have one array of objects like, I need to copy the value from one array to another array by excluding some of the elements
[
{
"personId": 1,
"personName": "Steve",
"CarName": "Swift",
"Price": "30L",
"OwnerType": "FirstHand",
"Address" : "xxx yyyy zzzz",
"Model" : "2015"
},
{
"personId": 2,
"personName": "Mike",
"CarName": "Breeza",
"Price": "40L",
"OwnerType": "SecondHand",
"Address" : "yyy uuu tttt",
"Model" : "2013"
},
{
"personId": 3,
"personName": "Elle",
"CarName": "Innova",
"Price": "70L",
"OwnerType": "FirstHand",
"Address" : "TTT RRR EEEE",
"Model" : "2018"
}
]
I want to copy this elements in one array to another array with only specified elements like
[
{
"personName": "Steve",
"CarName": "Swift",
"Price": "30L",
"Address" : "xxx yyyy zzzz",
"Model" : "2015"
},
{
"personName": "Mike",
"CarName": "Breeza",
"Price": "40L",
"Address" : "yyy uuu tttt",
"Model" : "2013"
},
{
"personName": "Elle",
"CarName": "Innova",
"Price": "70L",
"Address" : "TTT RRR EEEE",
"Model" : "2018"
}
]
I want to simply copy the elements in first array to another array without ownertype and person id