Good day.
How to find index of the element in array? No word about it in docs. Only way I found is:
let arr = [|1; 4; 5; 10|]
let elem = 5
let i = Array.findIndex (fun e -> e = elem) arr
You can create a shortcut function yourself if you use it frequently:
let findIndex arr elem = arr |> Array.findIndex ((=) elem)
...
let i = findIndex arr elem
((=) elem)and there isArray.IndexOfbut basically those are just a matter of tastetryFindIndexfor those cases where you aren't 100 % sure that the element is in the array.