nCr counts the unordered choices: nPr divided by the r! orderings of each choice.
To stay exact, multiply and divide alternately:
let res = 1;
for (let i = 1; i <= r; i++) res = res * (n - r + i) / i;
After step i, res equals C(n−r+i, i), which is always an integer, so the division is exact at every step. Also use C(n, r) = C(n, n−r) to loop over the smaller of the two.