I am a novice of ES6 JavaScript. I am looking for a scenario where i can update an object array that is coming from a web service and pass the data format to a table.
I am using ReactJS 'rc-table'.
https://www.npmjs.com/package/rc-table
To display our data in the rc-table format , We need to have an attribute key:"somevalue" in our data that is coming from the backend.
My data is in the following format:
{
{
Name:'Robert',
City: 'Barcelona'
},
{
Name: 'Marguaritte',
City: 'Baltimore'
}
}
Now it will display in rc-table format , only if the object has a unique key attribute.
For Example:
{
{
Name:'Robert',
City: 'Barcelona',
Key:1
},
{
Name: 'Marguaritte',
City: 'Baltimore',
Key:2
}
}
I am looking for updating my object with 'key:1' and 'key:2' Attached is my code. Any help would be appreciated.