Post

ruby array methods

include?

Check if an array includes a certain value.

1
2
3
4
5
my_arr = [1,2,3,4]
=> [1, 2, 3, 4]

my_arr.include? 4
=> true
This post is licensed under CC BY 4.0 by the author.