UPDATE: is not duplicated with question about path of objects, my question is mix objects and arrays elements with [0] or [1] or more ..
I have this code to try to get the errors, there a different 'paths' for errors; sometimes I need to change the error message accord to the path where I found the error.
Is there a way in lodash or js to ask if exist a path of object and arrays; by example:
_includes(err., 'graphQLErrors[0].state[0].key')
here my actual code:
try {
errorMessage = err.graphQLErrors[0].state[0].key; // general error message
} catch (e) { /* ignore the error */ }
i've been seen anothers links and solutiosn, but nothing to mix array and elements mixing elements [nElement] and arrays '.'