Here is the code to remove the duplicates from an array in Jquery.
in below code countries is an array which contains all the elements.
var unique_countries = countries.filter(function(itm,i,countries){return i == countries.indexOf(itm);});
in below code countries is an array which contains all the elements.
var unique_countries = countries.filter(function(itm,i,countries){return i == countries.indexOf(itm);});