Simple bug assigning new item ID in your REST API POST example

In your Node course, in the lesson about POST requests in a RESTful API, when a POST is used to add an item to a dataset you generate an ID for the new item by incrementing the length of the dataset. In other words if there are 3 items in the set, we assume they have ID values 1, 2, 3 so we use 4 for the new item’s ID.
This is not a good idea because it assumes items 1, 2 and 3 are still there. If item 1 is deleted the count is now 2 so the ID for a new item would be 3, but there is already an item with that value. The reliable way to generate a new ID would be to get the last item in the list and use that item’s ID + 1. Alternately the app could use a variable to keep track of the most recent ID.
Even in a simple teaching example I think this is worth mentioning.