在下面的代码中 ab 的值是多少?(它既不是未定义的,也不是空的,也不是空字符串)
var a = {} ;
a.b = [] ;
//////////////////////a.b["hello"]="hello"; //comment, uncomment for testing it
trace( a.b ) // output is invisible, something like blank string
trace( (a.b).length ); // 0 , this could be used but the index is string ie. "hello"
trace(a.b == undefined ) ; // false
trace(a.b == null) ; // false
伪代码:
if ( a.b is not having any type of content inside )
{
//How to get inside this part, when a.b is not having any value
// do this
}
else
{
//do this
}