Contents

subscript(_:as:)

Reads and writes the value at the given index as an integer value.

Declaration

subscript<T>(index: Int, as type: T.Type = T.self) -> T? where T : BinaryInteger { get }

Parameters

  • index:

    The position of the element to access.

  • type:

    The expected type for the returned value.

Return Value

The value at the specified index in the array, otherwise nil.

See Also

Accessing elements