What is the easiest way to remove duplicate from array of string. The array I have is :
<code>myarray = [name: "abc";lname: "xyz"; isSwitch: true; label: "Name"; show: true; values: ['Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'] ]
</code>
<code>myarray = [name: "abc";lname: "xyz"; isSwitch: true; label: "Name"; show: true; values: ['Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'] ]
</code>
myarray = [name: "abc";lname: "xyz"; isSwitch: true; label: "Name"; show: true; values: ['Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'] ]
I tried uniqArray = […new Set(myarray)]
but I guess I need to work on the “values” and not the entire array.
1