First I’d check if your data already has any unique field that you can use.

Usually your data comes from a backend and might already have an _id field, the index the database gave to that document.

Otherwise, you could npm install uuid and use that to create unique ids for each item.

Written by

Full Stack Software Engineer #javascript #EOS. Into Recreational Math / CS 🤯 Just message me about anything, my mind is open.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store