I get a list of arrays through jQuery of each function.
var spnTxt = '';
var arr = $('#id').find('span').each(function(utval) {
spnTxt = $(this).text();
});
It gives me
["pet", "dog", "london", "class"]
["pet", "cat", "newyork", "weight"]
["tech", "phone", "spain", "hello2"]
["tech", "phone", "spain", "hello"]
["tech", "phone", "spain", "hello"]
In my example above, I should get
["pet", "dog", "london", "class"]
["pet", "cat", "newyork", "weight"]
["tech", "phone", "spain", "hello2"]
["tech", "phone", "spain", "hello"]
Which one is unique. And my code below does not work. I'm not sure if he is right.
var dup = {};
var arr = $('#id').find('span').each(function(utval) {
spnTxt = $(this).text();
if (dup[spnTxt])
$(this).remove();
else
dup[spnTxt] = true;
});
Basically I want to remove a duplicate array if my rows in arrays are exactly similar to each other. How to achieve this