diff --git a/lodash.js b/lodash.js index bb17b4e59..2e950feec 100644 --- a/lodash.js +++ b/lodash.js @@ -331,10 +331,13 @@ */ function baseCompareAscending(value, other) { if (value !== other) { - if (value > other || typeof value == 'undefined') { + var valIsReflexive = value === value, + othIsReflexive = other === other; + + if (value > other || !valIsReflexive || (typeof value == 'undefined' && othIsReflexive)) { return 1; } - if (value < other || typeof other == 'undefined') { + if (value < other || !othIsReflexive || (typeof other == 'undefined' && valIsReflexive)) { return -1; } }