作者:小小鸟_--旺旺 | 来源:互联网 | 2023-05-16 20:48
I'm working with an array in AS3, which is sparse by default. I make an array and add a value to it at a given position. I nullify it's contents at that index. It retains that index value, but nullifies the contents. The issue is that the length still traces the same. Is there a way to actually remove that index without modifying any of the other indexes?
我正在使用AS3中的数组,默认情况下它是稀疏的。我创建一个数组并在给定位置添加一个值。我在该索引处使其内容无效。它保留该索引值,但使内容无效。问题是长度仍然跟踪相同。有没有办法在不修改任何其他索引的情况下实际删除该索引?
ex:
array:Array = new Array();
array[ 7 ] = new Array();
array[ 16 ] = new Array();
array[ 16 ] = null;
Edit: I want the array the array to stay as small as possible, so that in the example above the array would trace as length 7.
编辑:我希望数组中的数组尽可能小,以便在上面的示例中,数组将跟踪长度为7。
2 个解决方案