src/JSUtils/Session.js
function penalizeUnderscoreValueCompare(a, b) {
        var aName = a.value.toLowerCase(), bName = b.value.toLowerCase();
        // this sort function will cause _ to sort lower than lower case
        // alphabetical letters
        if (aName[0] === "_" && bName[0] !== "_") {
            return 1;
        } else if (bName[0] === "_" && aName[0] !== "_") {
            return -1;
        }
        if (aName < bName) {
            return -1;
        } else if (aName > bName) {
            return 1;
        }
        return 0;
    }
function penalizeUnderscoreValueCompare(a, b) {
        var aName = a.value.toLowerCase(), bName = b.value.toLowerCase();
        // this sort function will cause _ to sort lower than lower case
        // alphabetical letters
        if (aName[0] === "_" && bName[0] !== "_") {
            return 1;
        } else if (bName[0] === "_" && aName[0] !== "_") {
            return -1;
        }
        if (aName < bName) {
            return -1;
        } else if (aName > bName) {
            return 1;
        }
        return 0;
    }
function penalizeUnderscoreValueCompare ( a , b ) { var aName = a . value . toLowerCase ( ) , bName = b . value . toLowerCase ( ) ; // this sort function will cause _ to sort lower than lower case // alphabetical letters if ( aName [ 0 ] === "_" && bName [ 0 ] !== "_" ) { return 1 ; } else if ( bName [ 0 ] === "_" && aName [ 0 ] !== "_" ) { return - 1 ; } if ( aName < bName ) { return - 1 ; } else if ( aName > bName ) { return 1 ; } return 0 ; }
Comparison function used for sorting that does a case-insensitive string comparison on the "value" field of both objects. Unlike a normal string comparison, however, this sorts leading "_" to the bottom, given that a leading "_" usually denotes a private value.
Comparison function used for sorting that does a case - insensitive string comparison on the value field of both objects . Unlike a normal string comparison however this sorts leading _ to the bottom given that a leading _ usually denotes a private value .