Ok I am using a bunch of things form different sources. First to condense the array, @Thalaivar's answer nails it.
var array_input = [1,2, [1,2,3], [4,5,6, [9,8,10]]];
var pArray = array_input.join().split(',').map(Number);
Then, using this answer ad some slight modification (implement a number sort), we will remove any duplicates form the array while sorting it:
function uniqSort(a) {
return a.sort(function sortNumber(a,b) {
return a - b;
}).filter(function(item, pos, ary) {
return !pos || item != ary[pos - 1];
})
}
Then just call that function.
var array_output = uniqSort(pArray);