I really don't know how to do this. I want to remove the duplicate value of an array that has a multiple value. I tried to use the code from this post Compare arrays with jQuery [duplicate] but i didn't get the result i want. Please help me with this.
var arr1 = ["1,2,3", "4,5", "6", "7,8", "9,10"];
var arr2 = ["2", "4", "7,8"];
var result = []; //expected output: Array["1,3","5","6","9,10"]
$.each(arr1, function(i, val) {
if ($.inArray(val, arr2) < 0)
result.push(val);
});
console.log(result);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>