as3里的判断变量是否为空...

as3里的判断变量是否为空.

1)object 

var a={};
trace(a.id==undefined); //true  (其中id是真实要付的属性 )

2)array:

var b=[];
trace(b[0]==undefined) //true

注:在as3中,b[0].id==undefined是会报错的,而在as2中,是可以通过的

3)string

var c=new String()
trace(c=="")  //true

4)number

var d=new Number()
trace(d=="") //true 

5)arrayCollection

var a:ArrayCollection=new ArrayCollection()
   trace(a.length==0)  //true

你可能感兴趣的:(C++,c,C#)