.max(valueFn) fails with valueFn that returns NaN
benadamstyles opened this issue · comments
Ben Styles commented
Actual behaviour:
Lazy(['abc', '5', 'def']).max(x => parseInt(x, 10)) // => 'abc'
Lazy(['1', '5', 'def']).max(x => parseInt(x, 10)) // => '5'
Expected behaviour:
Lazy(['abc', '5', 'def']).max(x => parseInt(x, 10)) // => '5'
Lazy(['1', '5', 'def']).max(x => parseInt(x, 10)) // => '5'
Ben Styles commented
Actually been thinking about this and it's not really .max()
's responsibility to handle NaN
.