What is the best way to create new object from existing object with certain values, I mean i have one onbject and i want to create a new one with only the values that i need;
For example;
Existing object
data = [{
"ID": "234324234",
"calldate": "2018-03-25",
"callend": "2018-03-25",
"duration": "00:32",
"connect_duration": "00:01",
"progress_time": "2",
"first_rtp_time": "2",
"caller": "3243242342",
"caller_domain": "XXX.XXXX.XXX",
}, {
"ID": "5675675",
"calldate": "2018-03-12",
"callend": "2018-03-12",
"duration": "00:45",
"connect_duration": "00:04",
"progress_time": "2",
"first_rtp_time": "2",
"caller": "878678865",
"caller_domain": "XXX.XXXX.XXX",
}]
new Object required;
new_object = [{
"ID": "234324234",
"calldate": "2018-03-25",
"callend": "2018-03-25",
"caller": "3243242342",
}, {
"ID": "5675675",
"calldate": "2018-03-12",
"callend": "2018-03-12",
"caller": "878678865",
}]
question from:
https://stackoverflow.com/questions/65893989/best-way-to-create-new-object-from-existing-object-with-certain-values 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…