I have completed the project(build-a-prime-number-checker). Every time I click Run Tests, the page crashes (Error 4XX - 5XX
Client has disconnected from local server). Please help.
Your code so far
------------index.js ------
function isPrime(n) {
if (n < 2) return false;
if (n < 4) return true;
if (n % 2 === 0 || n % 3 === 0) return false;
for (let i = 5; i * i <= n; i += 6) {
if (n % i === 0 || n % (i + 2) === 0) {
return false;
}
}
return true;
}
module.exports = isPrime;
----package.json----
{
"name": "build-a-prime-number-checker-module",
"version": "1.0.0",
"description": "checks whether the input number is a prime number",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"prime number",
"prime",
"number",
"checker"
],
"author": "Akeem A.",
"license": "ISC",
"type": "commonjs"
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Challenge Information:
Build a Prime Number Checker Module - Build a Prime Number Checker Module
Your code was too long to be automatically inserted by the help button.
Please update the message, or reply to this one, to include your code, formatted as follows:
There are two ways you can format your code to make it easier to read and test:
After you copy/paste your code into the editor, select it by dragging your cursor over it then click the (</>) button in the toolbar to automatically wrap your code in backticks. (You can click on the animated demo image below to enlarge it.)
Manually add three backticks on a new line above your code and on a new line after your code. Note that a backtick is NOT the same as a single quote('). To find the backtick key on your keyboard, see this post.
To see changes to your post as you make them, you can click the (M+) button on the toolbar to bring up the rich text editor: