#Filtering problem
2 messages · Page 1 of 1 (latest)
2 messages · Page 1 of 1 (latest)
in showName fn, filteredName is an array (since the filter method returns an array).
your return statement :
return filteredName.name
is trying to accesss the name property as if filteredName was an object, but its an array. As a result, what's being returned is "undefined", which could be causing the problem
to fix this change your return statment to :
return filteredName[0].name