const myjson = {
"productname0": "Test1",
"price0": "10",
"categories0": "61",
"type0": "Physical",
"availability0": "available",
"weight0": "0.5",
"productname1": "Test2",
"price1": "20",
"categories1": "61",
"type1": "Physical",
"availability1": "available",
"weight1": "0.7",
}
I have an Object and I want to separate object. All the key value which has last number 0 it has own json, for 1 it has own json.
I want this result
[{
"productname0": "Test1",
"price0": "10",
"categories0": "61",
"type0": "Physical",
"availability0": "available",
"weight0": "0.5",
},
{
"productname1": "Test2",
"price1": "20",
"categories1": "61",
"type1": "Physical",
"availability1": "available",
"weight1": "0.7",
}]