Good afternoon, I try to get an array through Api using Object.key (obj) .map, but I get only its number. Can anyone help what I am doing wrong?
My array:
My code: I check the array:
var nameObj = item.categories; Object.keys(nameObj).forEach(function(name) { console.log(name + ': ' + nameObj[name]); }); Trying to withdraw:
let item = this.props.item; return ( <div className="back-info"> <p className='grey-text text-lighten-1'>Color:</p> {Object.keys(item.colors).map((id, name) => { return ( <a key={id} className='grey-text text-darken-4'>{name}</a> ) })} </div> ) Next output is this:


