Function replaceDuplicates
- replaceDuplicates<T>(array, fn, comparator?): T[]
-
Parameters
-
array: T[]
-
fn: ((duplicateItem, duplicateItemIndex, numberOfTimesReplaced) => T)
-
- (duplicateItem, duplicateItemIndex, numberOfTimesReplaced): T
-
Parameters
-
duplicateItem: T
-
duplicateItemIndex: number
-
numberOfTimesReplaced: number
Returns T
-
Optional
comparator: ((firstElement, nextElement) => 0 | 1 | -1)
-
- (firstElement, nextElement): 0 | 1 | -1
-
Parameters
-
firstElement: T
-
nextElement: T
Returns 0 | 1 | -1
Returns T[]