```
const uniquePaths = (m, n) => {
const makeMatrix = (m, n) => Array(m).fill(Array(n).fill(1));
let matrix = makeMatrix(m, n);
for(let i = 1; i < m; i++) {
for(let j = 1; j < n; j++) {
matrix[i][j] = matrix[i-1][j]+matrix[i][j-1];
}
}
return matrix[m-1][n-1];
};
```