var fruits = ["Banana", "Orange", "Apple", "Mango"];
var index = fruits.indexOf("Apple");
let fruits = ["Banana", "Orange", "Apple", "Mango"];
let index = fruits.???
If there is no equivalent, maybe you can point me in the right direction? I found this example, but it's for vectors, not arrays.
You can use the method
position
on any iterator. You can get an iterator over an array with theiter()
method. Try it like this: