Sugar icon indicating copy to clipboard operation
Sugar copied to clipboard

Array.max seems to have trouble with empty strings - Cannot compare with undefined

Open thomasf1 opened this issue 8 years ago • 1 comments

The following code throws an "Cannot compare with undefined" error

test = ['', 'AAAA', 'hello world', 'b']
test.max('length')

This works, the issue is with the empty string:

test = ['AAAA', 'hello world', 'b']
test.max('length')

thomasf1 avatar Jun 20 '17 21:06 thomasf1

Sorry for the delay here... this was a bug and I've put in a fix. Thanks!

andrewplummer avatar Aug 03 '18 14:08 andrewplummer