Note: If the keys are numeric, all elements will get new keys, starting from 0 and increases by 1. (See example 2).
注意:如果每个元素对应的键是数值型,那么剩下的元素将重新获得新的数值键,且从0开始以基数1递增(见案例2)。
Tip: Remember that if you skip the key when you specify an array, an integer key is generated, starting at 0 and increases by 1 for each value. (See example 3)?
提示:还记得吗?你过你忽略了指定函数中的键,将产生一个整数;且这些函数从“0”开始递增,每一个值增加“1”。(看案例3)?
In the example of Listing 1, new elements are always appended at the end, and therefore numbers_out's cardinality increases by 1 each time an element is added as shown in line 18.
清单1示例中,新的元素总是附加在末尾,因此每次添加一个元素,numbers_out的基数就增加1,如第18行所示。
And unlike n, l can start all the way down at 0, and it increases by integer value, so we go 1, 2, 3, and all the way up.
不像n,l可以从0开始取,然后每次增加一个整数,所以我们可以去1,2,3,一直下去。
应用推荐