Good afternoon! I am looking to create a fixed array of length 5, where I want to store recent viewed ids. And when it reaches the limit to delete elements from the end.
For example:
array = ['5', '4', '3', '2', '1'] // Array of 5 with ID's
When I add an id the array want to be like this:
array = ['6', '5', '4', '3', '2'];
And keep going.
Thank you so much for taking your time and I respect your help.