const phoneDirectory = {};
const personNames = ['Mira', 'Royce', 'Kathie'];
const contactNumbers = ['3234958675', '9164059384', '4154958675']
function combineArraysIntoObject(personNames, contactNumbers) {
for(i = 0; i < personNames.length; i++) {
phoneDirectory[personNames[i]] = contactNumbers[i];
}
}
Is there a way to loop through both arrays simultaneously and use names as keys and numbers as values in the resulting object?