var techologylist=[1,2,2,3,4,4,5]
var newtechologylist=[];
$.each(techologylist, function (i, el) {
if ($.inArray(el, newtechologylist) === -1) newtechologylist.push(el);
});
console.log(newtechologylist)
I want to remove values from techologylist ,if same 2 value comes .In my example 2 and 4 comes twice ,therefore i want to remove both 2 and 4 from array
Am expecting result as [1,3,5]
But result for my code of course give result as [1,2,3,4,5]
How to change my script to remove both values if duplicate occurs