How to remove duplicate value in Array?If same value,neglect it and if unique value push into same array.
Apr 18, 2022
Suppose, we have the following array list:
We can see the ram is repeating 2 times and its properties is also repeating 2 times.We need single ram and single properties (4 gb ) to be printed.Similar case applied to size,color.
Full Code combining:
Or, We can also use reduce method as it reduces our code.
Output: