summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorClaudio Secco <claudiosecco@hotmail.com>2020-05-02 13:03:36 -0300
committerClaudio Secco <claudiosecco@hotmail.com>2020-05-02 13:03:36 -0300
commita67f4663eb1b477cb50da9986fc5da945864ebab (patch)
treeafb78a82e6ccde8e7fa5da8b08e86a700d40e30c
parentf21a011eb4923c59343ec8f8dc1ab3166e9de6ba (diff)
include %w option
-rw-r--r--ruby.html.markdown3
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