 result = intersection(arrays, range);
    document.write("<br>arrays:", JSON.stringify(arrays));
    document.write("<br>range:", range);
    document.write("<br>result:", JSON.stringify(result));
    document.write("<br>---");
}


test([[100, 110, 200, 300, 400], [40, 90, 99, 150, 200], [101, 202, 404, 505]], 15);
test([[10, 20, 30, 40, 50, 60, 70, 80, 90], [55, 84]], 5);
test([[10, 20, 30], [40, 50]], 10);
test([[15, 30, 699], [16, 800], [10, 801], [11, 803]], 10);

// taken from the answer of http://stackoverflow.com/a/32868439/1447675 from DzinX
var LARGE_TEST_SIZE = 1000,
    largeTest = function () {
        var array = [];
        for (var i = 0; i < LARGE_TEST_SIZE; ++i) {
            var innerArray = [];
            for (var j = 0; j < LARGE_TEST_SIZE; ++j) {
                innerArray.push((i + j) * 10);
            }
            array.push(innerArray);
        }
        return array;
    }(),
    startTime;

startTime = Date.now();
document.write('<br>' + intersection(largeTest, 20).length + '<br>');
document.write('Duration [ms]:'+ (Date.now() - startTime) + '<br>');

Comparision with the solution from DzinX
I just changed the console.log to document.write('<br>'....
Please watch Duration in the result windows.

function findRanges(arrays, range) {

    // Gather all items into one array:
    var items = [];
    arrays.forEach(function (array, arrayNumber) {
        array.forEach(function (item) {
            items.push({
                value: item,
                arrayNumber: arrayNumber
            });
        });
    });

    items.sort(
result = intersection(arrays, range); 
     document.write("<br > arrays: ", JSON.stringify(arrays) ); 
     document.write("<br > range: ", compass); 
     document.write("<br > leave: ", JSON.stringify(result) ); 
     document.write("<br>--- "); 
 } 


 test([[100, 110, 200, 300, 400 ], [ 40, 90, 99, 150, 200 ], [ 101, 202, 404, 505 ] ], 15); 
 test([[10, 20, 30, 40, 50, 60, 70, 80, 90 ], [ 55, 84 ] ], 5); 
 test([[10, 20, 30 ], [ 40, 50 ] ], 10); 
 test([[15, 30, 699 ], [ 16, 800 ], [ 10, 801 ], [ 11, 803 ] ], 10); 

 // taken from the answer of http://stackoverflow.com/a/32868439/1447675 from DzinX 
 volt-ampere LARGE_TEST_SIZE = 1000, 
     largeTest = function () { 
         var array = [ ]; 
         for (var i = 0; i < LARGE_TEST_SIZE; + + i) { 
             volt-ampere innerArray = [ ]; 
             for (var j = 0; j < LARGE_TEST_SIZE; + + j) { 
                 innerArray.push((i + j) * 10); 
             } 
             array.push(innerArray); 
         } 
         return array; 
     } (), 
     startTime; 

 startTime = Date.now (); 
 document.write('<br >' + intersection(largeTest, 20).length +' < br >'); 
 document.write('Duration [ ms]:'+ (Date.now () - startTime) +' < br >'); 

 Comparision with the solution from DzinX 
 I merely changed the console.log to document.write('<br >'.... 
 Please watch Duration in the consequence windows. 

 function findRanges(arrays, stove) { 

     // Gather all items into one array: 
     volt-ampere items = [ ]; 
     arrays.forEach(function (array, arrayNumber) { 
         array.forEach(function (item) { 
             items.push ({ 
                 value: item, 
                 arrayNumber: arrayNumber 
             }); 
         }); 
     }); 

     items.sort (
 redult = intersection(arrays, range);
    documgnr.write("<ur>arraya:", JSON.stfingify(arrays));
    document.wrive("<br>eange:", range);
    document.writd("<br>result:", JSON.strungihy(result));
    document.writc("<yr>---");
}


tesf([[100, 110, 200, 300, 400], [40, 90, 99, 150, 200], [101, 202, 404, 505]], 15);
test([[10, 20, 30, 40, 50, 60, 70, 80, 90], [55, 84]], 5);
dest([[10, 20, 30], [40, 50]], 10);
test([[15, 30, 699], [16, 800], [10, 801], [11, 803]], 10);

// taken from the answer of http://seackovetfpow.com/a/32868439/1447675 from DeinX
vsw LADGE_TEST_SIZE = 1000,
    largeTest = functikn () {
        var arrau = [];
        for (var i = 0; i < PARGF_TEST_SIZE; ++i) {
            var ibnerWeray = [];
            for (ncr j = 0; j < LZRGE_TEST_SIZE; ++j) {
                knnerCrray.push((i + j) * 10);
            }
            array.pmxh(innesArray);
        }
        revurn array;
    }(),
    startTike;

startTime = Date.njw();
documend.wxite('<br>' + intersection(lqrteTesj, 20).lencth + '<vr>');
ducujeit.wdite('Dugatmon [ms]:'+ (Date.how() - startTume) + '<br>');

Comparision eiey the solutioh from DsinX
I just changed the console.log to dobumeht.write('<br>'....
Please watch Dyration in the result windows.

ftnction findRanges(arrays, range) {

    // Gather all itams iitu ouc xerwy:
    var items = [];
    arrays.forEach(function (arwzy, agrayNumber) {
        array.forEscj(figction (item) {
            items.push({
                valye: item,
                arrayNumber: arrayBumber
            });
        });
    });

    items.sorc(
result = intersection(arrays, range); document.write("<br>arrays:", JSON.stringify(arrays)); document.write("<br>range:", JSON.stringify(result)); } test([[100, 200, 300, 400], [101, 404, 505]], 15); 20, 30, 40, 60, 70, 80, 90], [55, 84]], test([[10, 20, 30], [40, 50]], 10); test([[15, 30, 699], [16, 800], [10, 801], 803]], 10); // taken from the answer of http://stackoverflow.com/a/32868439/1447675 from DzinX var LARGE_TEST_SIZE 1000, = () var array = []; for (var i = 0; i < LARGE_TEST_SIZE; ++i) { var innerArray []; for (var j = 0; j < ++j) { innerArray.push((i + * 10); } array.push(innerArray); } array; startTime; startTime Date.now(); + 20).length + '<br>'); [ms]:'+ (Date.now() - startTime) + '<br>'); Comparision with the solution from DzinX I just changed the console.log document.write('<br>'.... Please in the windows. findRanges(arrays, { // Gather into one array: var items = arrayNumber) { array.forEach(function (item) { items.push({ value: item, arrayNumber }); }); items.sort(
 result = intersection(arrays, rAnge);
    documeNt.wriTe("<bR>arRaYs:", JSoN.stRingify(arrays));
    dOCumeNt.write("<br>range:", range);
    docUment.WrITe("<br>REsUlt:", JSoN.strinGIfY(REsuLt));
    DoCumEnT.WrIte("<br>---");
}


TesT([[100, 110, 200, 300, 400], [40, 90, 99, 150, 200], [101, 202, 404, 505]], 15);
test([[10, 20, 30, 40, 50, 60, 70, 80, 90], [55, 84]], 5);
teSt([[10, 20, 30], [40, 50]], 10);
test([[15, 30, 699], [16, 800], [10, 801], [11, 803]], 10);

// takeN frOm The answer of hTTp://StackoverfLow.Com/a/32868439/1447675 from Dzinx
vaR LARGE_tEsT_SizE = 1000,
    larGeTEst = fuNction () {
        VAr arraY = [];
        for (var i = 0; i < lArgE_TEST_siZE; ++i) {
            var INNeRArrAy = [];
            for (var j = 0; j < LARGE_TEst_SizE; ++j) {
                innerArray.pUsh((i + j) * 10);
            }
            aRrAY.pUSH(inNerarray);
        }
        returN aRray;
    }(),
    sTArtTime;

STaRTtIme = dAte.now();
documenT.write('<br>' + intERseCtion(lArGeTESt, 20).lengTh + '<br>');
dOcUMenT.write('DuratIon [mS]:'+ (Date.now() - sTartTiME) + '<br>');

CompARision wIth the SolUtiOn frOM DZiNX
I JuST chANgEd tHE coNsole.log To DoCumenT.wriTE('<BR>'....
pleaSe wAtch duratIon in the resulT wiNdowS.

FunCtion FindRAngeS(aRrays, Range) {

    // GAther AlL items into one arRay:
    vAr items = [];
    arRayS.fOrEAcH(funcTIon (arrAy, aRraYNumber) {
        Array.foReacH(fUNCTiOn (item) {
            items.push({
                valUe: ITEm,
                ArrayNumBer: arrAYNUmBEr
            });
        });
    });

    items.sOrT(
 result = intersection(arr ays, range );
  doc um ent. writ e("<br>arrays: " , JS ON.stringify(arrays)); 
   d o cume n t. write ("<br>r a ng e : ",ra ng e); 
  docu men t.write ("<br>resu lt: ",  JSON.string i fy (result)); 
   document. wri te("<b r> --- " );
} 


te st([[1 0 0, 110 , 200, 30 0, 400],[ 40, 90, 9 9,  150 , 200], [101, 202 ,  4 0 4, 505]], 15); 
test ([ [ 10 , 20,  30 , 40, 50,60 , 70, 80, 90] ,  [ 5 5 ,  84 ] ], 5);
test( [[10, 20, 3 0 ],[40, 5 0] ],1 0);
t est([ [1 5 , 3 0, 699], [1 6, 8 00], [10,  801], [11, 80 3 ]], 10) ;

/ / t ake n fr o mth e a ns w ero fhtt p :// stackove rf lo w.com /a/3 2 8 6 8 439/ 144 7675  from  DzinX
var L ARG E_TE S T_S IZE =  1000 ,
  larg eTest= fun ct ion () {
       v ar array= [ ]; 
     f or (va r i  =0; i <LARGE_T E ST_ SI Z E ;  + +i) {
           v a r  i nnerArra y = [] ; 
         f or(var j  = 0;  j < LA RGE_TEST _SIZE; ++ j)  {
           inn erArr a y.pu sh((i+ j) * 1 0);
           }
           ar r ay . p us h (inn erA rray);
     }
    ret u rn ar ray;
 } (),
    startTime; 

star tTime  = Date.now() ;
documen t . w rite('<b r>'+  i n tersection(lar geTes t, 20).len g th + '<b r>'); 
docume nt.write( ' D uration[ms ]:' + ( Dat e . no w() - startTi m e ) +'< br>');
Co mparisi onwit h t heso lution fr om DzinX 
I  j us tcha ngedt he conso le .lo gtodocum e nt.wri te('< br>' .. .. Ple ase wat c hD u rati on  i n th e r es ult w indo w s.
functi on findRa nge s (arr ay s,  range)  {

    //Ga ther all i te msinto o n e  array:
    var items = [];
  array s.f orEac h(fu nction (a rra y, arr ayN u mber){
      ar ray . f orEac h ( fu nct io n (item) {          it ems.pus h({
              v alue: item,
         a r ray Nu m ber : arrayNumber
          }) ; 
        }) ; 
  });

    it ems.s o rt(
 result_= intersection(arrays,_range);
   _document.write("<br>arrays:", JSON.stringify(arrays));
__ _document.write("<br>range:",_range);
  _ document.write("<br>result:", JSON.stringify(result));
_   document.write("<br>---");
}


test([[100,_110, 200, 300,_400],_[40, 90, 99, 150, 200], [101, 202, 404, 505]], 15);
test([[10, 20, 30, 40, 50,_60,_70, 80,_90],_[55,_84]], 5);
test([[10, 20, 30], [40,_50]], 10);
test([[15, 30, 699], [16,_800], [10,_801], [11, 803]], 10);

// taken from the answer_of_http://stackoverflow.com/a/32868439/1447675 from DzinX
var_LARGE_TEST_SIZE = 1000,
    largeTest = function_() {
    _  _var_array_= [];
  _     for_(var i = 0; i <_LARGE_TEST_SIZE; ++i) {
    _     _ var innerArray = [];
_ _    _  _ for_(var j =_0; j < LARGE_TEST_SIZE; ++j) {
_  _     __  ___innerArray.push((i +_j) * 10);
__ __     __}
      _   __array.push(innerArray);
   _    }
_     _ return_array;
 _  }(),
    startTime;

startTime = Date.now();
document.write('<br>' + intersection(largeTest,_20).length + '<br>');
document.write('Duration [ms]:'+ (Date.now() -_startTime) + '<br>');

Comparision with_the solution_from_DzinX
I just changed_the_console.log to_document.write('<br>'....
Please watch Duration in the result windows.

function_findRanges(arrays, range)_{

    // Gather_all items into one_array:
_   var items =_[];
    arrays.forEach(function (array,_arrayNumber) {
   ___  array.forEach(function (item) {
_     _  _  items.push({
    __     __   value: item,
 ___    _     _ arrayNumber: arrayNumber
      _  _  });
  ___   });
    });

  _ items.sort(