Partitioning an array of objects into four arrays by one attribute
This can easily be done with array.reduce

let resultsByMethod = data.reduce((results, result) =&gt; {
  if(!results[result.method]) results[result.method] = [];
  results[result.method].push(result);
  return results;
}, {});


The end result is something like:

{
  GET: [...],
  POST: [...],
  PUT: [...],
  DELETE: [...]
}


One disadvantage in your approach is when it encounters a method that's note one of the 4 you're comparing.