nsTArraynums; nums.AppendElements({1, 2, 3}); // nums contains 1, 2, 3 nums.SetLength(5, 0); // nums now contains 1, 2, 3, 0, 0
nsTArrayThis example shows how to decrease the size of an nsTArray from 3 to 2 elements by calling SetLength() with a new size of 2. Any elements beyond the new size will be removed. Package/Library: Mozilla Gecko engine.nums; nums.AppendElements({1, 2, 3}); // nums contains 1, 2, 3 nums.SetLength(2); // nums now contains 1, 2