Hi. I have an array which I am populating as I navigate through the site. Sometimes due to cicumstances apparently out of my control, I end up with two (never more) duplicate values consecutively placed in my array, here is an example:
groceries = [“bananas”, “apples”, “apples”, “oranges”];
I need to run a script at all times that checks to see if this happens, and removes the second duplicate value, as well as it’s corresponding key.
How can I do this?
Thank you in advance!