summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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