Skip to content

Commit c0e3a69

Browse files
accessdbbatsov
authored andcommitted
Show results of using the splat operator (rubocop#534)
1 parent f88e1de commit c0e3a69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -710,11 +710,11 @@ Translations of the guide are available in the following languages:
710710
first, second = multi_return
711711

712712
# good - use with splat
713-
first, *list = [1, 2, 3, 4]
713+
first, *list = [1, 2, 3, 4] # first => 1, list => [2, 3, 4]
714714

715-
hello_array = *'Hello'
715+
hello_array = *'Hello' # => ["Hello"]
716716

717-
a = *(1..3)
717+
a = *(1..3) # => [1, 2, 3]
718718
```
719719

720720
* <a name="trailing-underscore-variables"></a>

0 commit comments

Comments
 (0)