size
instead of count
RB-PR1020size
instead of count
.72
73
74# Raises "Use `size` instead of `count`"
75[1, 2, 3].count
size
should be preferred over count
. Read more here.
[1, 2, 3].count
{a: 1, b: 2, c: 3}.count
[1, 2, 3].size
{a: 1, b: 2, c: 3}.size
[1, 2, 3].count { |e| e > 2 }