I just started programming with javascript no long ago. But I am still confused with the way it handles arrays. the problem is that I have an array in which there some content as undefined. I want to check for those undefined values and escape them. How do I do it. the following code is not working and I have not found a way to solve this problem.
if(myarray[0]!=='undefined')
if(myarray[0])!='undefined') // I have also tried
if(myarray[0]).search('undefined')==(-1)) // and also this
however none of these options is working. I could see when debugging that the value in the array is 'undefined' but the condition is never met. once again my aim is to do something when it is not undefined. please how could I do it. I found a similar question Test if something is not undefined in JavaScript but it does not work