开发者

Annoyances of Flex - Associative Array

开发者 https://www.devze.com 2022-12-13 04:16 出处:网络
I have an associative array and while iterating through this array, using foreach loop. Flex is loosing the order. This开发者_运维问答 is so annoying.

I have an associative array and while iterating through this array, using foreach loop. Flex is loosing the order. This开发者_运维问答 is so annoying.

Why is this happening?

How can i avoid this?


Per the specification, the values in an associative array are not "ordered".

If you need to get values in a specified order, you'll need to sort the keys yourself.


Associative arrays are implementation of the Hash table data structure, and hence are unordered by nature.

0

精彩评论

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