Longest common prefix
I would find the alphabetically smallest and largest string and just run your algorithm on these two. That would avoid the embedded loop.

var longestCommonPrefix = function(strs) {
    if (!strs)
        return '';

    let smallest = strs.reduce( (min, str) =&gt; min &lt; str ? min : str, strs[0] );
    let largest  = strs.reduce( (min, str) =&gt; min &gt; str ? min : str, strs[0] );

    for (let i=0; i&lt;smallest.length; i++) {
        if (smallest[i] != largest[i])
            return smallest.substr(0,i);
    }

    return '';
};


In answer to konijn it would be minimally faster to get the smallest/largest by doing:

let smallest = strs[0];
let largest  = strs[0];
for (let i=1; i&lt;strs.length; i++) {
  let s= strs[i];
  if (s &gt; largest)  largest = s;
  if (s &lt; smallest) smallest = s;
}