Проверьте на наличие NULL
const maybeNull = null
if(maybeNull) { console.log("Not null") } else { console.log("Could be null") }
// Could be null
for(let i = 0; null; i++) { console.log("Won't run") }
maybeNull ? console.log("truthy value") : console.log("Falsy value")
// falsy value
Inquisitive Iguana