I'm encountering an issue with this code snippet. I have a check in place to ensure that the value of 'startups[i].logo' is not undefined, however I am still receiving an error stating that it may be undefined. Can anyone provide insight as to why this error is occurring?
for (let i = 0; i < startups.length; i++) {
let startup = startups[i];
if (startups[i] && startups[i].logo && startups[i].logo.location) {
aStartup.push({
objectID: startups[i].id,
logo: startups[i].logo.location,
});
batchCount ++;
}