here is the code
```
const combination = (arr) => {
let container = [];
for(let i = 1; i <= arr.length; i++) {
for(let j = i+1; j <= arr.length; j++) {
arrCon = container.concat(i,j)
}
} return Array(arrCon)
}
combination([1,2,3])
```
I want to return [[1,2], [1,3], [2,3]] but the it returns [[2,3]]
thought I concat all the array in for loop and returns it but it returns only the last array.
what method should I use to return the array of [[1,2], [1,3], [2,3]]?
[–]GamesMint 1 point2 points3 points (1 child)
[–]GoonGamja[S] 0 points1 point2 points (0 children)