-1

I'm looking to get the indexes of unique values within an array. I've found several solutions to removing duplicate values of an array, for instance here:

How to get unique values in an array

but am having trouble finding how to get back the indexes of those unique values vs. the values themselves.

Thank you!

christopher
  • 137
  • 8

1 Answers1

0

const fruits = ["Banana", "Orange", "Apple", "Mango"];
console.log(fruits.indexOf("Apple") )
Aman Sharma
  • 933
  • 1
  • 4
  • 12