I'm trying to map an object like this in a but it doesn't work.
manager: [{…}]
0:
12:
name: "Name1"
surname: "Surname1"
agenda: Array(2)
0: {date: "2020-05-27", start_at: "09:00:00", end_at: "10:00:00"}
1: {date: "2020-05-27", start_at: "10:00:00", end_at: "11:00:00"}
length: 2
__proto__: Array(0)
__proto__: Object
13: {name: "Name2", surname: "Surname2", agenda: Array(1)}
__proto__: Object
length: 1
__proto__: Array(0)
How can I do??
Firstly I have an array (without agenda) and I have done in this way, but now it doesn't work.
<select title="Choose" onChange={(event) => this.handleChangeManager(event)}>
<option value="" title="Choose" data-content="Cancel <span class='reset-label'></span>"></option>
{managers && managers.length && managers.map((manager, key) => (
<option key={key} value= {manager.id} name="manager_id" >{manager.name} {manager.surname}</option>
))}
</select>
I would have the possibility to create a using the name and surname, but also to enter inside the Agenda array (in this case I should do something like manager.agenda.date to visualize the date?)
manageris an array, but not exactly sure what content does it have inside it. Can you share an image of what you get fromconsole.log( manager )