To find the length of an array in Ruby, you can use any of the three methods: length
, size
, or count
. Here's an example of how to use each method:
main.rb207 chars12 lines
All three methods will return the same result, which is the number of elements in the array.
gistlibby LogSnag