I have an object that looks like this:
{
accord: {
model_type: 'Car',
totalCapacity: 4,
maxSpeed:170,
kms: 140000
},
ram: {
model_type: 'Car',
totalCapacity:5,
maxSpeed: 220
kms: 14000
},
corvette: {
model_type: 'Car',
totalCapacity: 2,
maxSpeed: 300,
kms: 50000,
}
}
and I am trying to copy this object into one that looks like this:
{
accord: {
maxSpeed:170,
},
ram: {
maxSpeed: 220
},
corvette: {
maxSpeed: 300,
}
}
Ive tried cloning it to an array with object keys and making an object using those values but it doesnt seem to work. I feel like there is a much easier way to do this though
Each object in the main object(accord, ram, corvette) can be different everytime and there can be more than 3 or less than 3 as well