Basically I have an array where there are similar items close by, but I would like to find a way where I leave these items that are the same apart from each other ex:
var array = [1,2,3,3,4];
var myWishArray = [1,2,3,4,3];
||
var myWishArray = [3,2,3,4,1];
||
var myWishArray = [3,2,3,1,4];
...