I want to make permutation with javascript, this is my code

```
const arr = [1, 2, 3, 4, 5];

for (let i1 = 0; i1 < arr.length; i1++) {
  for (let i2 = i1 + 1; i2 < arr.length; i2++) {
    console.log(arr[i1] + ' ' + arr[i2]);
  }
}

```

<https://jsfiddle.net/op51x6mv/1/>

result from that code: 

`["1 2", "1 3", "1 4", "1 5", "2 3", "2 4", "2 5", "3 4", "3 5", "4 5"]`

I want to ask, why are all the results from the permutation not displayed? From these results I did not see the numbers 

`["2 1", "3 1", "3 2", "4 1", "4 2", "4 3", "5 1", "5 2", "5 3", "5 4"]`

please tell Me where the error from this code? or if You have a better code please help Me.

Thank you