Nth Prime

ecma/function/prime-nth/code/prime-nth.mjs:

import { isPrime } from '../../prime/code/prime.js';

/**
 * begin: 1..n
 * end: 1..n, end > begin
 */
function nthPrime(nth) {
  // TODO
}

export { nthPrime };

ecma/function/prime-nth/code/prime-nth.print.mjs:

import { nthPrime } from './prime-nth.mjs';

// Number Tools

// looking for the first 4 prime number
console.log(nthPrime(4));
console.log(7);

// looking for the first 6 prime number
console.log(nthPrime(6));
console.log(13);

Response