I have an array of objects
const myarray = [ { name: 'Alex', job: 'Doctor' }, { name: 'John', job: 'Taxi Driver' }, { name: 'Marc', job: 'Taxi Driver' }, ]
How can i, for each job, print the name of the job, then all the corresponding objects ?
For example I want to be able to display:
Doctor: Alex
Taxi driver: John, Marc