Skip to content

Commit

Permalink
Improve first/last docstrings (#39560)
Browse files Browse the repository at this point in the history
* improve first/last docstrings

improve `first`/`last` docstrings to indicate that two new methods have been added since v1.6 (#34868)

* Update abstractarray.jl

remove the trailing whitespaces
  • Loading branch information
huangyxi authored Feb 8, 2021
1 parent 5ab3ed6 commit bc2b854
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ end
Get the first `n` elements of the iterable collection `itr`, or fewer elements if `v` is not
long enough.
!!! compat "Julia 1.6"
This method requires at least Julia 1.6.
# Examples
```jldoctest
julia> first(["foo", "bar", "qux"], 2)
Expand Down Expand Up @@ -439,6 +442,9 @@ last(a) = a[end]
Get the last `n` elements of the iterable collection `itr`, or fewer elements if `v` is not
long enough.
!!! compat "Julia 1.6"
This method requires at least Julia 1.6.
# Examples
```jldoctest
julia> last(["foo", "bar", "qux"], 2)
Expand Down

0 comments on commit bc2b854

Please sign in to comment.