title: Array.some is not a function
body: <p>I am attempting to pass 2 arrays to a function that filters through array 1 by array 2, then returns the filtered results.</p>
  
  <p>I am not understanding why I am getting the error: "Uncaught TypeError: arr2.some is not a function"</p>
  
  <p>Function Code:</p>
  
  <pre><code>function filterTF(arr1,arr2) 
  {
      return arr1.filter(function(el) 
      {
          return arr2.some(function(e) 
          {
              return el.timeframe == e;
          });
      });
  }
  </code></pre>
  
  <p>Array 1:</p>
  
  <pre><code>[
      {"time":"2016-11-30 02:45:00","signal":"Buy","symbol":"AUDNZDecn","price":"1.04605","timeframe":"M15","epoch":"1480473900","candel":"M151480481100"},{"time":"2016-11-30 02:41:00","signal":"Sell","symbol":"AUDJPYecn","price":"84.08700","timeframe":"M1","epoch":"1480473660","candel":"M11480480860"},{"time":"2016-11-30 02:24:59","signal":"Buy","symbol":"EURNZDecn","price":"1.48820","timeframe":"M5","epoch":"1480472699","candel":"M51480479900"}
  ]
  </code></pre>
  
  <p>Array 2: </p>
  
  <pre><code>5,15
  </code></pre>
  
  <p>Code that Runs the Function:</p>
  
  <pre><code>var timeframearr = localStorage.getItem("timeframe");
  
  if(timeframearr.length === 0) 
  {
      console.log("Wings - Timeframe Set: False");
      var timeframearr = [];
  } 
  else 
  {
      var j = filterTF(j,timeframearr);
  } 
  </code></pre>
  
  <p><strong>Note:</strong> j is equal to a JSON parsed server response from an AJAX query that talks to a php script, which passes back a JSON response, aka the array above. timeframearr is either created new if its length is equal to 0, or if it exists in local storage then it gets it from there.</p>
  
  <p>Code that puts timeframearr in local storage:</p>
  
  <pre><code>if ($('#timeframe-checkbox1').is(":checked")) 
  {
      var t1 = $('#timeframe-checkbox1').val();
      console.log($('#timeframe-checkbox1').val());
      timeframearr.push(t1);
  }
  
  if ($('#timeframe-checkbox2').is(":checked")) 
  {
      var t2 = $('#timeframe-checkbox2').val();
      console.log($('#timeframe-checkbox2').val());
      timeframearr.push(t2);
  }
  
  if ($('#timeframe-checkbox3').is(":checked")) 
  {
      var t3 =  $('#timeframe-checkbox3').val();
      console.log($('#timeframe-checkbox3').val());
      timeframearr.push(t3);
  }
  
  localStorage.setItem("timeframe", timeframearr);
  </code></pre>
  
  <p><strong>Goal:</strong> What I am trying to accomplish/understand is how to do is filter by multiple "timeframe" values of the array at a time, so that when a user clicks a checkbox for a combination of any of the three timeframes, I can pull the value from the checkboxes and filter the array by whatever combination of checkboxes the user had selected. ex. "M1", "M5", "M15", "M1,M5" or M1,M15" or M5,M15" or "M1,M5,M15" and so on.</p>
  
  <p>The new array that is returned/filtered will get passed to a jquery each loop, that will then go through the data and append the data to a div. (I have this part working already)</p>
  
  <p>Appreciate any guidance!</p>