andrewplummer / Sugar

A Javascript library for working with native objects.
https://sugarjs.com/
MIT License
4.53k stars 306 forks source link

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

Open thomasf1 opened 7 years ago

thomasf1 commented 7 years ago

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')
andrewplummer commented 6 years ago

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