Wrong way to sort ?

Wrong way to sort ?

LapointeLapointe Posts: 373Questions: 70Answers: 4

Tks

For searchbuilder 1.0.1, I found something starnge at line 2190 :

if (that.s.type === 'array' || that.s.type === 'string' || that.s.type === 'num' || that.s.type === 'html' || that.s.type === 'html-num') {
    if ($(a).val() < $(b).val()) {
        return -1;
    }
    else if ($(a).val() < $(b).val()) {
        return 1;
    }
    else {
        return 0;
    }
}

I mean result is strange, because comparision is the same 2 times, not ?

Bob

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.