lib/observable.js
function binarySearch(o, v, i, compareFunction){
    var h = o.length, l = -1, m
    while(h - l > 1)
        if(compareFunction(o[m = h + l >> 1], v) < 1) l = m
        else h = m
    return o[h] != v ? i ? h : -1 : h
}
function binarySearch(o, v, i, compareFunction){
    var h = o.length, l = -1, m
    while(h - l > 1)
        if(compareFunction(o[m = h + l >> 1], v) < 1) l = m
        else h = m
    return o[h] != v ? i ? h : -1 : h
}
function binarySearch ( o , v , i , compareFunction ) { var h = o . length , l = - 1 , m while ( h - l > 1 ) if ( compareFunction ( o [ m = h + l >> 1 ] , v ) < 1 ) l = m else h = m return o [ h ] != v ? i ? h : - 1 : h }
modified version of + Carlos R. L. Rodrigues @ http://jsfromhell.com/array/search [rev. #2] o: array that will be looked up v: object that will be searched b: if true, the function will return the index where the value should be inserted to keep the array ordered, otherwise returns the index where the value was found or -1 if it wasn't found
modified version of + Carlos R . L . Rodrigues