Skip to main content

Range.at

atindex

Group: Selections

Documentation

Gets an element from the Range at a specified index (0-based).

Arguments

  • index: The location in the Range to get the element from. The index is also allowed be negative, then the elements are indexed from the back, i.e. -1 will correspond to the last element.

Examples

Get the second element of a range.

      0.up_to 10 . get 1 == 1

Get the last element of a range with step.

     0.up_to 10 . with_step 2 . get -1 == 8