Removes consecutive doubles.
If no argument is provided, standard !== will be used to compare both values.
If a mapping fn is provided, the result of the mapping fn will be compared using !==,
which means the mapping function should produce a 'simple' types like number or string.
(The alternative option would have been to pass 2 arguments to the compare fn and if
it returns true, the elements would be considered equal)
Removes consecutive doubles. If no argument is provided, standard !== will be used to compare both values. If a mapping fn is provided, the result of the mapping fn will be compared using !==, which means the mapping function should produce a 'simple' types like number or string.
(The alternative option would have been to pass 2 arguments to the compare fn and if it returns true, the elements would be considered equal)
Example
Example