What am I doing wrong here?
let items = [{ name: 'client1' },
{ name: 'client2' },
{ name: "client3"}];
for (let i = 0; i < items.length; i++) {
if (items[i]['name'].includes(self.autocomplete)) {
self.box += '<li>' + items[i]['name'] + '</li>';
}
}
I keep receiving the error message "Uncaught TypeError: Cannot read property 'name' of undefined."