title: How to get all pairs of array JavaScript
body: <p>I need to call function with all avaliable pairs of array elements. Like this:</p>
  <pre><code>[1, 2, 3].pairs(function (pair) {
    console.log(pair); //[1,2], [1,3], [2,3]
  });
  </code></pre>