How to remove the repetition of preferred countries. I need to add all the African countries as preferred countries in the dropdown list.
code i used for that.
preferredCountries: [ "gh", "dz","ao","bj","bw","bf","bi","cm","cf","td","km","cd","dj","eg","gq","er","sz","et","ga","gm","gq","gw","ke","ls","lr","ly","mg","mw","ml","mr","mu","ma","mz","na","ne","ng","rw","sn","sc","sl","so","za","ss","sd","tz","tg","tn","ug","zm","zw" ],
You can use a Set to get the unique values here, then use the ... spread operator to return to an array:
Another example: