Skip to content

Commit

Permalink
Tweak some wording
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Nov 28, 2023
1 parent 5dcdd37 commit 6c4b859
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4222,13 +4222,17 @@ When accessing the first or last element from an array, prefer `first` or `last`
----
arr = [1, 2, 3]
# bad
# ok
arr[0] # => 1
arr[-1] # => 3
# good
# (arguably) better
arr.first # => 1
arr.last # => 3
# good - assignments can only be done via []=
arr[0] = 2
arr[-1] = 5
----

=== Set vs Array [[set-vs-array]]
Expand Down

0 comments on commit 6c4b859

Please sign in to comment.