return the number of elements in @array.
$ size(%hash)return the number of elements in %hash.
@array, %hash - the data structure to get the number of elements from
size(%hash)
executes in O(n) time. This is because it loops through the hash and keys associated with $null. If you'd like to avoid this behavior use [[%hash getData] size
instead.@a = @("a", "b", "c", "d", "e"); $size = size(@a); println($size);
5