diff options
author | Claudio Secco <claudiosecco@hotmail.com> | 2020-05-02 13:03:36 -0300 |
---|---|---|
committer | Claudio Secco <claudiosecco@hotmail.com> | 2020-05-02 13:03:36 -0300 |
commit | a67f4663eb1b477cb50da9986fc5da945864ebab (patch) | |
tree | afb78a82e6ccde8e7fa5da8b08e86a700d40e30c /ruby.html.markdown | |
parent | f21a011eb4923c59343ec8f8dc1ab3166e9de6ba (diff) |
include %w option
Diffstat (limited to 'ruby.html.markdown')
-rw-r--r-- | ruby.html.markdown | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ruby.html.markdown b/ruby.html.markdown index 376f4a47..97f7a516 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -181,6 +181,9 @@ array = [1, 2, 3, 4, 5] #=> [1, 2, 3, 4, 5] # Arrays can contain different types of items. [1, 'hello', false] #=> [1, "hello", false] +# You might prefer %w instead of quotes +%w[foo bar baz] #=> ["foo", "bar", "baz"] + # Arrays can be indexed. # From the front... array[0] #=> 1 |