> For the complete documentation index, see [llms.txt](https://gold.gitbook.io/kotlin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gold.gitbook.io/kotlin/collections/aggregate-operations/any.md).

# any

컬렉션 안에 element 가 하나라도 있다면 true 를 반환하는 함수

```kotlin
public fun <T> Iterable<T>.any(): Boolean {
    for (element in this) return true
    return false
}

val list = listOf(1, 2, 3, 4, 5)
println(list.any()) // true
val emptyList = listOf<Int>()
println(emptyList.any()) // false
```

```kotlin
public inline fun <T> Iterable<T>.any(predicate: (T) -> Boolean): Boolean {
    for (element in this) if (predicate(element)) return true
    return false
}

val list = listOf(1, 2, 3, 4, 5)

println(list.any{ it > 3 }) // true
println(list.any{ it > 0 }) // true
println(list.any{ it > 5 }) // false
```
