@@ -2029,14 +2029,12 @@ class Array[unchecked out Elem] < Object
20292029 # With a block given, calls the block with successive elements of the array;
20302030 # returns the first element for which the block returns a truthy value:
20312031 #
2032- # (0..9) .find {|element| element > 2} # => 3
2032+ # [1, 3, 5] .find {|element| element > 2} # => 3
20332033 #
20342034 # If no such element is found, calls `if_none_proc` and returns its return
20352035 # value.
20362036 #
2037- # (0..9).find(proc {false}) {|element| element > 12} # => false
2038- # {foo: 0, bar: 1, baz: 2}.find {|key, value| key.start_with?('b') } # => [:bar, 1]
2039- # {foo: 0, bar: 1, baz: 2}.find(proc {[]}) {|key, value| key.start_with?('c') } # => []
2037+ # [1, 3, 5].find(proc {-1}) {|element| element > 12} # => -1
20402038 #
20412039 # With no block given, returns an Enumerator.
20422040 #
@@ -3022,17 +3020,15 @@ class Array[unchecked out Elem] < Object
30223020 # Returns the last element for which the block returns a truthy value.
30233021 #
30243022 # With a block given, calls the block with successive elements of the array in
3025- # reverse order; returns the last element for which the block returns a truthy
3023+ # reverse order; returns the first element for which the block returns a truthy
30263024 # value:
30273025 #
3028- # (0..9). rfind {|element| element < 5} # => 4
3026+ # [1, 2, 3, 4, 5, 6]. rfind {|element| element < 5} # => 4
30293027 #
30303028 # If no such element is found, calls `if_none_proc` and returns its return
30313029 # value.
30323030 #
3033- # (0..9).rfind(proc {false}) {|element| element < -2} # => false
3034- # {foo: 0, bar: 1, baz: 2}.rfind {|key, value| key.start_with?('b') } # => [:baz, 2]
3035- # {foo: 0, bar: 1, baz: 2}.rfind(proc {[]}) {|key, value| key.start_with?('c') } # => []
3031+ # [1, 2, 3, 4].rfind(proc {0}) {|element| element < -2} # => 0
30363032 #
30373033 # With no block given, returns an Enumerator.
30383034 #
0 commit comments