Skip to content

Commit 6c4b859

Browse files
committed
Tweak some wording
1 parent 5dcdd37 commit 6c4b859

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.adoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4222,13 +4222,17 @@ When accessing the first or last element from an array, prefer `first` or `last`
42224222
----
42234223
arr = [1, 2, 3]
42244224
4225-
# bad
4225+
# ok
42264226
arr[0] # => 1
42274227
arr[-1] # => 3
42284228
4229-
# good
4229+
# (arguably) better
42304230
arr.first # => 1
42314231
arr.last # => 3
4232+
4233+
# good - assignments can only be done via []=
4234+
arr[0] = 2
4235+
arr[-1] = 5
42324236
----
42334237

42344238
=== Set vs Array [[set-vs-array]]

0 commit comments

Comments
 (0)