# Find function in Julai 1.7 -- still supported?

**URL:** <https://discourse.julialang.org/t/find-function-in-julai-1-7-still-supported/78950>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [April 3, 2022, 3:40pm UTC](https://discourse.julialang.org/t/find-function-in-julai-1-7-still-supported/78950 "2022-04-03T15:40:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luigi\_Marongiu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luigi_marongiu/32/7909_2.png) [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Post date:** [April 3, 2022, 3:40pm UTC](https://discourse.julialang.org/t/find-function-in-julai-1-7-still-supported/78950/1 "2022-04-03T15:40:56Z")

</div>

Hello,  
I would like to find the element of a vectos above a certain threshold. I am trying with:

```julia
a = [1 2 3 4 3 5 3 6 7 8 9 3]
find( x->(x == 3), a)
find(a .== 3

```

but

```julia
julia> find( x->(x == 3), a)
ERROR: UndefVarError: find not defined
Stacktrace:
 [1] top-level scope
   @ none:1
julia> find(a .== 3)
ERROR: UndefVarError: find not defined
Stacktrace:
 [1] top-level scope
   @ none:1

julia> findall( x->(x == 3), a)
4-element Vector{CartesianIndex{2}}:
 CartesianIndex(1, 3)
 CartesianIndex(1, 5)
 CartesianIndex(1, 7)
 CartesianIndex(1, 12)

julia> findall(a .== 3)
4-element Vector{CartesianIndex{2}}:
 CartesianIndex(1, 3)
 CartesianIndex(1, 5)
 CartesianIndex(1, 7)
 CartesianIndex(1, 12)

```

How do I get the first true element?

---

<div class="post-metadata">

**Author:** ![denshd](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/denshd/32/32247_2.png) [@denshd](https://discourse.julialang.org/u/denshd)\
**Post date:** [April 3, 2022, 3:51pm UTC](https://discourse.julialang.org/t/find-function-in-julai-1-7-still-supported/78950/2 "2022-04-03T15:51:41Z")

</div>

Hello! Try `findfirst()` function:

[findfirst(predicate::Function, A)](https://docs.julialang.org/en/v1/base/arrays/#Base.findfirst-Tuple%7BFunction,%20Any%7D)

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [April 3, 2022, 5:55pm UTC](https://discourse.julialang.org/t/find-function-in-julai-1-7-still-supported/78950/3 "2022-04-03T17:55:15Z")

</div>

or `findall` or type `find` in the repl and press tab to get more suggestions.
