Could someone provide insight into why this code snippet functions as intended:
filteredArray = contacts.filter(
(contact: Contact) => contact.name.toLowerCase().includes(term.toLowerCase())
);
while this variation does not:
filteredArray = contacts.filter((contact: Contact) => {
contact.name.toLocaleLowerCase().includes(term.toLocaleLowerCase());
});
I'm struggling to understand why the addition of curly braces in the second example appears to disrupt the functionality.