Hello BattleCat! You forgot to access the object’s properties: phonebook is an array of objects, so if you want to access the name property of the ith element (object) of the array, you have to write phonebook[i].name (phonebook[i] is the object itself, which you can’t compare with the string name; that’s why the if statement was always false).
Here is the correct code, where I also added a new variable, phonebookEntry, to store the current element within the loop:
for (let i = 0; i < phonebook.length; i++) {
let phonebookEntry = phonebook[i];
if (phonebookEntry.name === name) {
para.textContent = `${phonebookEntry.name} : ${phonebookEntry.number}`;
break;
}
// ...