Iterative binary search
JavaScript (94 bytes)

(a,e)=&gt;{u=a.length,m=0;for(l=0;l&lt;=u;)e&gt;a[m=(l+u)&gt;&gt;1]?l=m+1:u=e==a[m]?-2:m-1;return u==-2?m:-1}


Expanded out a little so you can see what's going on:

function binary_search(array, elem) {
    let u = array.length, m;
    for (let l = 0; l &lt;= u;)
        if (elem &gt; array[(m = (l + u) &gt;&gt; 1)]) l = m + 1;
        else u = (elem == array[m]) ? -2 : m - 1;
    return (u == -2) ? m : -1;
}


Example usage:

&gt; a = [1,2,3,4,5,6,7,8,9,10]
&gt; binary_search(a, 5)
4
&gt; binary_search(a, 15)
-1