remove duplicates from array list code example
Example 1: python remove duplicates from list
# remove duplicate from given_list using list comprehension
res = []
[res.append(x) for x in given_list if x not in res]
Example 2: remove duplicate value from array
let chars = ['A', 'B', 'A', 'C', 'B'];
let uniqueChars = [...new Set(chars)];
console.log(uniqueChars);