I'm getting TypeError: theArray.find(...) is undefined from a code that is in essence similar to this:
if (!Array.isArray(theArray)) console.error("WARNING! theArray is not an array: ", theArray);
console.log(theArray.find((element) => element).someProperty);
I'm not getting the error message WARNING! theArray is not an array, but I'm getting the error theArray.find(...) is undefined
The error message does not say that theArray is undefined, this is an error message that I would except when theArray is not of type array.
Inside the array function there would be a more complex logic, but I simlified it to focus on the Array.find() problem.
The variable theArray is an array of complex objects, with a lot of properties.
someProperty. I still haven't solved my own problem, but it seems that withoutsomePropertyit would work, so this will be a problem with properties and not Array.find(). I will write down the solution when I find it.