When you use the length property it allocates space and assigns it to the immutable array. the array now contains data (10 0's). You've said you won't change any data in it's declaration but the array itself can be changed (appending or a different array).

I would think the best solution is to create a mutable local version, and then assign the immutable global one when you are done. If the array is particularly short (Like your example), then appending will work fine for your values (unless you mutate the array as part of it's calculation, then a local copy is required).

Reply via email to