Get a value's index number after query result

I have a query result that I want to extract the index number of an item using the value of a field key,


In this above example, how do I find out the index is 6 by using -colors: “Navy”-?

This code gives me the array shown above

wixData.query("options")
        .contains("details", $w("#detailsdropdown").value)
        .limit(1000)
        .find()
        .then(results => {
            results.items

thanks in advance

Something like this should do it:

let numIndex = results.items.findIndex(item => item.colors === "Navy");

I knew it just had to be a basic single function operation!
Thank you Giri… worked like a charm