diff options
author | Kouhei Yanagita <[email protected]> | 2023-02-15 12:43:55 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2023-02-15 12:43:55 +0900 |
commit | 619af4fd6404168a368442941ec80e739aef2609 (patch) | |
tree | 67dd04ea0555031eb045e7462fca4fbb01747d49 /doc/syntax/assignment.rdoc | |
parent | f03dd4ee778cbed7ea9510385b9bbdbdcf6d485b (diff) |
[DOC] Add an example of the splat operator with a non-array object (#7098)
Notes
Notes:
Merged-By: hsbt <[email protected]>
Diffstat (limited to 'doc/syntax/assignment.rdoc')
-rw-r--r-- | doc/syntax/assignment.rdoc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/syntax/assignment.rdoc b/doc/syntax/assignment.rdoc index 037c2032a8..e30cb35adf 100644 --- a/doc/syntax/assignment.rdoc +++ b/doc/syntax/assignment.rdoc @@ -403,6 +403,10 @@ assigning. This is similar to multiple assignment: p a # prints [1, 2, 3] + b = *1 + + p b # prints [1] + You can splat anywhere in the right-hand side of the assignment: a = 1, *[2, 3] |