I'm trying to turn an object that I have into and array of objects, I know there must be a simple way of doing this but I cannot seem to figure it out after searching. I'm probably searching the wrong thing.
I've tried pushing to an array but I need each key and value pair to be a separate object in an array.
This is the object that I'm working with:
{ HI: 1,
undefined: 7,
MI: 1,
FL: 1,
WV: 1,
TX: 1,
IA: 3,
MN: 1,
MO: 1 }
Not quite sure how to turn each of those values into an object, yes I'm stupid.
the desired output would be [{stateName:'HI' value: 1},{stateName: 'Mi', value: 4},{stateName: 'TX', value: 1}]
and so on.