This article does not take the key or value , but the key needed for extraction: "value" [must be a single array, if multiple sets of data need a for loop]
// row is a json string!!!
1. I have a single json [row] as long as the id and appStatus are separated into new arrays
let list = [];
for (var key in row) {
var temp = {
}
if (key == "id") {
temp.id = row[key]
list.push(temp)
} if (key == 'appStatus') {
temp.appStatus = row[key]
list.push(temp)
}
}
console.log(list)
2. I have a single json [row] as long as the id and appStatus are not separated together
Method 1: Use numbers in row[0] brackets to get the corresponding key: "value"
Method 2: Customize
var satusJson = {
"id": row.id,
"appStatus": row.appStatus,
}
console.log(satusJson)
3. I have a single json [row] except for id and appStatus.
const {
id, appStatus, ...param } = row;
console.log(param);