开发者

Length of Object map actionscript

I have an object using as a map in actionscript

var map:Object = new Object();

map[1] = "one";
map[2] = 开发者_Go百科"one";

Is there any easy way to get length of map without iterating?


It may not be better, but I think it's easier to use ObjectUtil...

import mx.utils.ObjectUtil;
ObjectUtil.getClassInfo(map).properties.length;

That would return 2 in your case.


No, the easiest way is iterating the map.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜