want to create an array of objects that contains the first alphabet of the people as the key and an array of the names that start with that name.
Example:
const listContacts = [ {name: 'Ana maria', phone: '5555-5555'}, {name: 'Anthony M. Tabor', phone: '5553-5555'}, {name: 'Lorraine J. Welling', phone: '5553-5585'}, {name: 'Bertha A. Mathis', phone: '5553-5587'}, {name: 'Frankie M. Wilson', phone: '5553-5587'}, {name: 'Steven M. Long', phone: '5553-5587'}, {name: 'Carole T. Cook', phone: '5553-4587'}, ]; // Expected output const newListContacts = [ { A: [ {name: 'Ana maria', phone: '5555-5555'}, {name: 'Anthony M. Tabor', phone: '5553-5555'}, ], }, { B: [{name: 'Bertha A. Mathis', phone: '5553-5587'}], }, { C: [{name: 'Carole T. Cook', phone: '5553-4587'}], }, { F: [{name: 'Frankie M. Wilson', phone: '5553-5587'}], }, { L: [{name: 'Lorraine J. Welling', phone: '5553-5585'}], }, { S: [{name: 'Steven M. Long', phone: '5553-5587'}], }, ];