Similar to Array.map, except that any time that an item in the input causes the callback function to throw an error,
an error handler will be invoked rather than aborting. These items will be skipped in the output, so unlike Array.map(),
it's possible that the output array may contain a different number of items from the input.
Type parameters
T
U
Parameters
array: T[]
callback: function
(T: any): U
Parameters
T: any
Returns U
errCallback: function
(item: T, error: Error, result: U[]): void
Parameters
item: T
error: Error
result: U[]
Returns void
Optional thisArg: any
Returns U[]
Static max
max<T>(items: T[], callback: function): any
Calculates the maximum of all items based on a callback selector value.
Similar to Array.map, except that any time that an item in the input causes the callback function to throw an error, an error handler will be invoked rather than aborting. These items will be skipped in the output, so unlike Array.map(), it's possible that the output array may contain a different number of items from the input.