summaryrefslogtreecommitdiffhomepage
path: root/ruby.html.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'ruby.html.markdown')
-rw-r--r--ruby.html.markdown3
1 files changed, 3 insertions, 0 deletions
diff --git a/ruby.html.markdown b/ruby.html.markdown
index 1883d1ad..800f0445 100644
--- a/ruby.html.markdown
+++ b/ruby.html.markdown
@@ -169,6 +169,9 @@ array[1..3] #=> [2, 3, 4]
# Add to an array like this
array << 6 #=> [1, 2, 3, 4, 5, 6]
+# Check if an item exists in an array
+array.include?(1) #=> true
+
# Hashes are Ruby's primary dictionary with keys/value pairs.
# Hashes are denoted with curly braces:
hash = { 'color' => 'green', 'number' => 5 }