1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[DOC] Improve an example of Array#count comparison [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2021-03-29 11:35:38 +09:00
parent 875c85a8bd
commit f46bbb2e99
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -6094,7 +6094,7 @@ rb_ary_compact(VALUE ary)
* [].count # => 0
*
* With argument +obj+, returns the count of elements <tt>==</tt> to +obj+:
* [0, 1, 2, 0].count(0) # => 2
* [0, 1, 2, 0.0].count(0) # => 2
* [0, 1, 2].count(3) # => 0
*
* With no argument and a block given, calls the block with each element;