So, I’m working on https://learn.freecodecamp.org/coding-interview-prep/project-euler/problem-7-10001st-prime where for given parameter `n`

I need to return n-th prime number. My code works, but it’s not fast enough. Any suggestions?

```
function isPrimeNumber(number) {
for (let i = 2; i < number; i++) {
if (number % i == 0) return false;
}
return true;
}
function nthPrime(number) {
let counter = number - 1;
let currentNumber = 1;
if (number == 2) return counter;
while (counter) {
currentNumber += 2;
if (isPrimeNumber(currentNumber)) counter--;
}
return currentNumber;
}
```