REACT: generating unique keys

If you’re sure it only contains unique values, you can use the item itself.

The above will generate unique keys for an array with duplicates:

  • “HTML-0”
  • “Bootstrap-1”
  • “JavaScript-2”
  • “HTML-3”

etc…