Answer the question
In order to leave comments, you need to log in
How to check for Undefined?
How to make a check for undefined so that the program is not cut off with a warning?
Tried to do so
var o = {
action: getRandomItems
}
if(typeof o.children !== undefined){
}
var o = {
action: getRandomItems
}
if(!!o.children){
}
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'children' of undefined
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question