qversion.js
/**
 * compare two semantic version numbers a and b,
 * return -1 if a is less than, 1 if a is greater than b,
 * 0 if they are the same.
 */
compare two semantic version numbers a and b,
return -1 if a is less than, 1 if a is greater than b,
0 if they are the same.
compare two semantic version numbers a and b return - 1 if a is less than 1 if a is greater than b 0 if they are the same .
function version_compare( a, b ) {
    var aa = a.split('.');
    var bb = b.split('.');
    for (var i=0; i<aa.length; i++) {
        var ai = aa[i], bi = bb[i];
        if (ai !== bi) {
            if (!bi) return 1;                          
            else if (!ai) return -1;                    
            return parseInt(ai, 10) - parseInt(bi, 10); 
        }
    }
    if (aa.length < bb.length) return -1;               
    return 0;
}
function version_compare ( a , b ) { var aa = a . split ( '.' ) ; var bb = b . split ( '.' ) ; for ( var i = 0 ; i < aa . length ; i ++ ) { var ai = aa [ i ] , bi = bb [ i ] ; if ( ai !== bi ) { if ( ! bi ) return 1 ; else if ( ! ai ) return - 1 ; return parseInt ( ai , 10 ) - parseInt ( bi , 10 ) ; } } if ( aa . length < bb . length ) return - 1 ; return 0 ; }
compare two semantic version numbers a and b,
 return -1 if a is less than, 1 if a is greater than b,
 0 if they are the same.
compare two semantic version numbers a and b return - 1 if a is less than 1 if a is greater than b 0 if they are the same .
// bb was prefix of aa, aa > // aa empty // versions differ // aa was prefix of bb, aa <