diff --git a/vlib/arrays/arrays.v b/vlib/arrays/arrays.v index c729bc0be1..becd3b1733 100644 --- a/vlib/arrays/arrays.v +++ b/vlib/arrays/arrays.v @@ -681,7 +681,7 @@ pub fn carray_to_varray[T](c_array_data voidptr, items int) []T { // find_first returns the first element that matches the given predicate // returns `none`, if there is no match found -// Example: arrays.find_first([1, 2, 3, 4, 5], fn (arr int) bool { arr == 3}) // => 3 +// Example: arrays.find_first([1, 2, 3, 4, 5], fn (i int) bool { return i == 3 })? // => 3 pub fn find_first[T](array []T, predicate fn (elem T) bool) ?T { if array.len == 0 { return none @@ -696,7 +696,7 @@ pub fn find_first[T](array []T, predicate fn (elem T) bool) ?T { // find_last returns the last element that matches the given predicate // returns `none`, if there is no match found -// Example: arrays.find_last([1, 2, 3, 4, 5], fn (arr int) bool { arr == 3}) // => 3 +// Example: arrays.find_last([1, 2, 3, 4, 5], fn (i int) bool { return i == 3})? // => 3 pub fn find_last[T](array []T, predicate fn (elem T) bool) ?T { if array.len == 0 { return none