javascript - check for undefined not working -


i started programming javascript no long ago. still confused way handles arrays. problem have array in there content undefined. want check undefined values , escape them. how do it. following code not working , have not found way solve problem.

if(myarray[0]!=='undefined')  if(myarray[0])!='undefined') // have tried   if(myarray[0]).search('undefined')==(-1)) // , 

however none of these options working. see when debugging value in array 'undefined' condition never met. once again aim when not undefined. please how it. found similar question test if not undefined in javascript not work

you comparing undefined 'undefined', string different. need compare this:

myarray=[undefined]; if(myarray[0]!==undefined){     console.log(4) } 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -