0
I’m making a filter inside an array to pick up part of the element as typed in my search where:
array.filter(row => row.cnpj.indexOf(search) >= 0)
Considering 'search' the search typed, if inside the array, cnpj with null value will give error in the index:
TypeError: Cannot read property 'indexOf' of null
How do I filter this by ignoring the null values or else there is a better way to do this?
Could you show the rest of the code to understand the problem more easily?
– user7393973