[DOC] Add an example of the splat operator with a non-array object (#7098)

This commit is contained in:
Kouhei Yanagita 2023-02-15 12:43:55 +09:00 committed by GitHub
parent f03dd4ee77
commit 619af4fd64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
Notes: git 2023-02-15 03:44:15 +00:00
Merged-By: hsbt <hsbt@ruby-lang.org>

View File

@ -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]