Say I have a object that looks like this...
values = {
'student': [{
'field': 'prefix',
'description': 'First name'
},
{
'field': 'suffix',
'description': 'Last name'
},
{
'field': 'student_email',
'description': 'Email address'
}],
'classes': [{
'field': 'course_code',
'description': 'Course code'
}]
}
I'm trying to get
['prefix', 'suffix', 'student_email', 'course_code']
So this is what I have:
for (const v in values) {
v.map((obj, idx) => {
console.log(obj);
});
}
And it just returns v.map is not a function. How can I make this work, what am I doing wrong? (written in jsx).