I'm looking for the javascript equivalent of the php function isset()
. I've tried the method described here at JavaScript isset() equivalent but at firebug, error comes up saying
data.del is undefined //Firebug warning/error
if(typeof data.del[0].node != 'undefined') { // codes in my js file
And in some cases
data is null //Firebug warning/error
if(typeof data.storyLine != 'undefined') { // codes in my js file
The logic seems to work but I'm wondering why is there an error then??
Basically, I want to check whether data.del[0].node
or data.storyLine
isset or not??