I am using @mswjs/data
to generate a mock database and I have a property order
which is a number between 0 and the length - 1
of all entries. I want to render the current index in that property. I was looking through the GitHub repo, Google and StackOverflow, but was not able to find that.
So how can I render the current index when mocking the entries?
It only matters on creation, afterwards the property will be mutated when the items move around.
Otherwise, instead of the current index, it can be also just a random number between 0 and the last index of the entry, but it has to be unique and not shared among other entries.