The exact number of elements. Must be a non-negative integer literal.
The type of elements in the array (defaults to unknown).
const rgb = [255, 128, 0] as unknown as MutableFixedLengthArray<3, number>;
rgb[0] = 200; // OK — elements are mutable
const len: 3 = rgb.length; // `length` is the literal N (N <= 10)
const readonlyView: FixedLengthArray<3, number> = rgb; // OK
// const rgba: MutableFixedLengthArray<4, number> = rgb; // Error!
Mutable counterpart of FixedLengthArray: a branded mutable array type for arrays with exactly
Lengthelements. Alias forMutableBoundedLengthArray<Length, Length, Elm>.Identical to FixedLengthArray except that the structural part is mutable: for
Length <= 10it is intersected with the exact mutable tuple MutableFixedLengthTuple (solengthis the literalLength, in-range indexed access does not includeundefinedundernoUncheckedIndexedAccess, and elements can be reassigned); for larger lengths only the clamped mutable structural prefix inherited from MutableMinLengthArray remains. The brand is the same as FixedLengthArray, so aMutableFixedLengthArray<Length, Elm>is assignable toFixedLengthArray<Length, Elm>.