title: javascript pagination large array?
body: <p>i have array has over 10K records i need to paginate it , I've found a cool function but its work only in <code>foreground</code> in <code>background</code> i got Error <code>undefined _</code></p>
  
  <p>for example :</p>
  
  <pre><code>var myArray = bla.GetInfo(); //has over 10K records
  
  var page1 =  getPaginatedItems(myArray, 1 , 500 );
  
  //this function working fine only in foreground 
  function getPaginatedItems(items, page , per_page ) {
  
      var page           = page || 1,
          offset         = (page - 1) * per_page,
          paginatedItems = _.rest(items, offset).slice(0, per_page);
  
      return { page        : page,
               per_page    : per_page,
               total       : items.length,
               total_pages : Math.ceil(items.length / per_page),
               data        : paginatedItems
             };
  }
  </code></pre>
  
  <p>i think the problem from this method <code>_.rest</code> any ideas how make this function work in background ? if not dose anyone has similar function do same job ! without underscore methods ?</p>