RubyFlow The Ruby and Rails community linklog

Ruby's Array#count has some superpowers

What do you do in Ruby when you need to get a count of elements in an array? You use methods like count, size or length. Ok, but do you know what’s the difference between those methods? I’m not talking about Rails and ActiveRecord and the different approaches each of these methods take to return a count. I’m talking about plain old Ruby.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in