Let's imagine I have this array:
bucket.bucketList =[];
bucket.addItem = function(item) {
bucket.bucketList.push(item);
}
The function pushes an object called foo this into the array on every mouse-scroll:
Some foo's also have a property , foo.name = "something";
The question is, what is the best way to delete All duplicates based on their name property names whilst keeping the most recents one pushed in?
I am using jQuery already in my project, so if jQuery has a more elegant way of doing this than vanilla JS i'd be more than happy to use it.