package utils

func Find[T comparable](arr []T, callback func(v T, index int) bool) *T {
	var result *T = nil

	for i := 0; i < len(arr); i++ {
		if stop := callback(arr[i], i); stop {
			result = &arr[i]
			break
		}
	}

	return result
}
