In the Useful Array Tricks article, one of the tricks described how to ensure the contents of our array are unique and no duplicate items exist. The technique described really only worked when the array items in question were primitives like text or numbers. In this article, we will go one step further and look at another common case. What if the array items with potential duplicates were themselves arrays? How will we both identify the duplicate arrays and also remove those duplicates to ensure we have an array made up only of unique arrays? In this article, we’ll find out how!
Really enjoyed this article and didn’t even think about your approach when I saw your initial question. Glad you published the article and pointed out these additional methods.
This is so well explained .Thank you for the detailed explanation.
I have a list of stores with in an array.Each item in an array is an array with the store name and distance.I want to filter out the items that are closer to me.