lundi 15 octobre 2018

how to build an label from a object key

I have a model that returns an object like this

{type:"Fiat", model:"500", color:"white"}
{type:"ford", model:"f250", color:"green"}

I need create a label from the object keys for example type, model, color and a column that contains fiat, 500 etc. I was trying to use

model.map(elem=>{ Object.keys(elem)}

to get the keys but I am getting the keys of each item in the object. Is there a way to get the key value




Aucun commentaire:

Enregistrer un commentaire