Uncaught TypeError: Cannot read property 'toLowerCase' of undefined

mrBond
New Member
1 0 0

Im getting this error all of a sudden!

So here's the part of code:

const renderTodos = (todos, filters=> {
    const filteredTodos  = todos.filter((todo=>{
    const searchTextMatch = todo.text.toLowerCase().includes(filters.searchText.toLowerCase())   // here im getting the error!
    const HideCompletedMatch = !filters.HideCompleted || !todo.completed
    return  searchTextMatch && HideCompletedMatch
})
 
 
 
// please help me out. Thanks
0 Likes