I need to add new attribute for JSON object. currently my code like as below
let abc = this.dataSource.data;
console.log(abc);
console log data set like below
{
"result": [
{
"id": 210,
"temp": "210",
"city": "colombo",
"status": "waiting"
},
{
"id": 211,
"temp": "212",
"city": "colombo2",
"status": "waiting"
},
]
}
I need to add new attribute for the JSON object. My expect JSON object like below
{
"result": [
{
"id": 210,
"temp": "210",
"city": "colombo",
"status": "waiting"
"select": false,
},
{
"id": 211,
"temp": "212",
"city": "colombo2",
"status": "waiting",
"select": false,
},
]
}
I tried to do it using this,
abc = {...abc,select:false}
but it did not work. How I do this